mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-27 07:03:36 -04:00
bullet: Fix deadlock when contact added callback accesses certain data or executes bullet methods
This commit is contained in:
parent
f9a86bced6
commit
3097d2637c
@ -88,7 +88,12 @@ contact_added_callback(btManifoldPoint &cp,
|
||||
BulletManifoldPoint mp(cp);
|
||||
BulletContactCallbackData cbdata(mp, node0, node1, id0, id1, index0, index1);
|
||||
|
||||
// Release the world mutex object so that bullet methods can be called from the callback.
|
||||
LightMutex &mutex = BulletWorld::get_global_lock();
|
||||
|
||||
mutex.release();
|
||||
bullet_contact_added_callback->do_callback(&cbdata);
|
||||
mutex.acquire();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user