I just found an, uh, serious problem in Game Maker 8.0.
Create event of object0:
time = current_time;
for(i = 0; i < 10000; i += 1)
{
t = instance_create(0, 0, object1);
t.temp = script0(t);
if(instance_exists(t))
with(t) instance_destroy();
}
endtime = current_time;
show_message(current_time - time);
time = current_time;
for(i = 0; i < 100000; i += 1)
{
t = instance_create(0, 0, object1);
t.temp = script0(t);
if(instance_exists(t))
with(t) instance_destroy();
}
endtime = current_time;
show_message(current_time - time);
script0:
with(argument0) instance_destroy();
return 1;
First loop: no errors, nothing bad at all, finishes in less than a second.
Second loop: Finishes in 139777 milliseconds.
Basically, somehow, variables can be modified after their associated object is dead as long as their lvalue is referenced before the object is destroyed.