Skip to content

Commit

Permalink
bullet: Fix deadlock when contact added callback accesses certain dat…
Browse files Browse the repository at this point in the history
…a or executes bullet methods
  • Loading branch information
Souzooka authored and rdb committed Nov 19, 2023
1 parent f9a86bc commit 3097d26
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions panda/src/bullet/bulletContactCallbacks.h
Expand Up @@ -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();
}
}

Expand Down

0 comments on commit 3097d26

Please sign in to comment.