bullet: Fix deadlock when contact added callback accesses certain data or executes bullet methods

This commit is contained in:
Dakota Smith 2023-11-18 16:37:34 -05:00 committed by rdb
parent f9a86bced6
commit 3097d2637c

View File

@ -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();
}
}