BulletObjectTracker is not thread safe
patricksuo opened this issue · comments
Bullet/BulletSharp is not thread-safe in general.
You should synchronize threads when accessing BulletObjectTracker or any other Bullet objects.
I ran into AV crash in multi-thread app with BULLET_OBJECT_TRACKING
flag enabled.
But I can not reproduce without BULLET_OBJECT_TRACKING
flag.
So I look into what BULLET_OBJECT_TRACKING
is guarding.
I found this hashset
might be access by multi-thread without synchronization:
If you have multiple bullet instances on different threads, it could be problematic.
BulletSharpPInvoke/BulletSharp/BulletObjectTracker.cs
Lines 17 to 28 in 375acae
That's a good point. I added synchronization: 83fd5ea
Thanks.