Hi,
I experimented a strange crash while working on my game. What I did was, when quitting, first destroy my contact listener, and then destroy all the bodies (using DestroyBody, and not during a step). This worked fine, except when I quit while a contact was existing: in those cases I got the following segfault:
I report this because I do not think this specific case is explicitly covered in the "implicit destruction" chapter of the manual.
Deleting the contact listener after the bodies solved my issue, but other users might want to change the current listener in mid-game, or simply do the same mistake as I.
I experimented a strange crash while working on my game. What I did was, when quitting, first destroy my contact listener, and then destroy all the bodies (using DestroyBody, and not during a step). This worked fine, except when I quit while a contact was existing: in those cases I got the following segfault:
Code:
#0 0x00007f16ab04ddbd in b2ContactManager::Destroy(b2Contact*) () from /usr/lib/libbox2d.so.0
#1 0x00007f16ab036dbb in b2PairManager::Commit() () from /usr/lib/libbox2d.so.0
#2 0x00007f16ab037eb1 in b2BroadPhase::DestroyProxy(int) () from /usr/lib/libbox2d.so.0
#3 0x00007f16ab035e6c in b2Shape::DestroyProxy(b2BroadPhase*) () from /usr/lib/libbox2d.so.0
#4 0x00007f16ab04e71b in b2World::DestroyBody(b2Body*) () from /usr/lib/libbox2d.so.0
#1 0x00007f16ab036dbb in b2PairManager::Commit() () from /usr/lib/libbox2d.so.0
#2 0x00007f16ab037eb1 in b2BroadPhase::DestroyProxy(int) () from /usr/lib/libbox2d.so.0
#3 0x00007f16ab035e6c in b2Shape::DestroyProxy(b2BroadPhase*) () from /usr/lib/libbox2d.so.0
#4 0x00007f16ab04e71b in b2World::DestroyBody(b2Body*) () from /usr/lib/libbox2d.so.0
I report this because I do not think this specific case is explicitly covered in the "implicit destruction" chapter of the manual.
Deleting the contact listener after the bodies solved my issue, but other users might want to change the current listener in mid-game, or simply do the same mistake as I.