Destroying a joint causes an error
Posted: Sun Oct 17, 2010 5:53 am
OK, so now that I have a few days of spare time I'm trying to get my prototype build for my game finished. At the moment I've got some code that creates a circle shape and matching body which then attaches to the mouse so that you can drag it around. Clicking the left mouse button creates the object and holding the same mouse button drags it around. Finally, you'd release the mouse button to detach the circle from the mouse and have it become "free" as it were.
To do this I've written some code that destroys the joint when you release the mouse button but when I do this Love crashes. I did notice this excerpt from the wiki regarding destroying joints: "When you don't have time to wait for garbage collection, this function may be used to free the object immediately, but note that an error will occur if you attempt to use the object after calling this function." I assume that's what's happening here? If so, anyway around it?
To do this I've written some code that destroys the joint when you release the mouse button but when I do this Love crashes. I did notice this excerpt from the wiki regarding destroying joints: "When you don't have time to wait for garbage collection, this function may be used to free the object immediately, but note that an error will occur if you attempt to use the object after calling this function." I assume that's what's happening here? If so, anyway around it?