1
0
blueloveTH 2 жил өмнө
parent
commit
65219da87f

+ 3 - 0
3rd/box2d/src/box2d_World.cpp

@@ -93,6 +93,9 @@ void PyWorld::_register(VM* vm, PyObject* mod, PyObject* type){
 
     vm->bind(type, "step(self, dt: float, velocity_iterations: int, position_iterations: int)",
         [](VM* vm, ArgsView args){
+            // disable gc during step for safety
+            auto _lock = vm->heap.gc_scope_lock();
+
             PyWorld& self = _CAST(PyWorld&, args[0]);
             float dt = CAST(float, args[1]);
             int velocity_iterations = CAST(int, args[2]);