This project has moved and is read-only. For the latest updates, please go here.

3.3 Dispose

Topics: Developer Forum, User Forum
Mar 31, 2012 at 10:25 PM

So I've been researching the proper way dispose of an object and I've found some contradicting answers.

The first topic I read mentioned that I should set up a remove queue when I want to remove an object since it's a horrible idea to use dispose() in the middle of a physics step.

The next topic I read mentioned that after 3.2, if I use dispose() during OnCollision, Farseer will automatically cache this decision and take care of it when the time step is over.

Now onto my question:

Is this true for 3.3 also? If so, is it a good idea to do it this way, or should I set up the remove queue anyway?

Also, I have a second question regarding dispose(). If I call dispose on a fixture, does this subsequently dispose of anything else attached to it? Or do I have to first dispose of the body, then the fixture?


Thank you for your help in advance guys.

Apr 1, 2012 at 2:27 PM

iirc world.removebody(body) removes the body after the current step