Trying to figure out a workaround that let me still use physics.stop() and the only one that seems to work is to be super-anal about removing EVERY SINGLE object used in the simulation before calling physics.stop().
So if all your physics objects are in a layer group called, say “layer_physical”, then something like this before calling physics.stop() should prevent the crash:
for i = layer_physical.numChildren, 1,-1 do
layer_physical[i]:removeSelf()
end
Notice the for loop is moving backwards through the list of objects since if you go forward from 1 to numChildren to delete them it will actually skip every other object due to the way indexing works on a shrinking list of objects.
I still think there should be a better warning from Corona than a bus error crash in the event that there are some physics objects left in the simulation after physics.stop() is called. Seems like a pretty common and easy mistake to make (especially for programming newbs like me!) [import]uid: 9422 topic_id: 2084 reply_id: 41406[/import]