Skip to content

Commit

Permalink
Added explicit GIL releasing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chukobyte committed Jun 7, 2021
1 parent c994811 commit 902462a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/core/scripting/python/python_script_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,13 @@ class PythonScriptContext : public ScriptContext {
}

void PhysicsProcess(Entity entity, double deltaTime) override {
if (PyObject_HasAttr(pythonCache->GetClassInstance(entity), physicsProcessFunctionName)) {
CPyObject processCallValue = PyObject_CallMethod(pythonCache->GetClassInstance(entity), "_physics_process", "(f)", deltaTime);
PyGILState_STATE pyGilStateState = PyGILState_Ensure();
{
if (PyObject_HasAttr(pythonCache->GetClassInstance(entity), physicsProcessFunctionName)) {
CPyObject processCallValue = PyObject_CallMethod(pythonCache->GetClassInstance(entity), "_physics_process", "(f)", deltaTime);
}
}
PyGILState_Release(pyGilStateState);
PyErr_Print();
}

Expand Down

0 comments on commit 902462a

Please sign in to comment.