Proper usage of free?

Hello all,

In my simulation, when I attempt to use free on an object ("self free"), the simulation will sometimes crash. The free is called during a to iterate method, which goes onto several other tasks which call self at some point. I was under the impression that once free was called, the freed object would no longer execute.

What sort of situations could cause such a crash? I'm thinking right now that before one "to iterate" method finishes execution, the next one starts, allowing the free command to be called twice.

simulation crash, or breve crash?

Is free causing a simulation crash or a breve crash? If it is crashing your simulation, then the object is probably being used elsewhere without being tested first.

The engine should not allow two instances of the iterate method to happen at the same time.

- jon

Yes, it is a simulation

Yes, it is a simulation crash, and it seems to be that the object is still using itself in to-iterate after it has been freed.

I think I'll try to call free at the end of a to-iterate. Otherwise I'll just have to turn the objects invisible and non-reactive in the meantime.

Edit: I found the problem, and it is that another object is calling the freed object after freeing. Does anyone have an easy method to test if an object still exists or not? That would be most helpful, thanks.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.