Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchell Stokes <mogurijin@gmail.com>2012-12-25 12:11:21 +0400
committerMitchell Stokes <mogurijin@gmail.com>2012-12-25 12:11:21 +0400
commitf1270153e1efcd2c6ca1370a06691b0ccb3a9686 (patch)
tree2a3531200a7024d91882dd3bda60cb5d307781b6 /source/gameengine/Converter/KX_ConvertControllers.cpp
parenta418dfb98c34914fde81bdde9b10967fd05ae648 (diff)
BGE: Some various tweaks to try and get async lib loading to be a bit more stable on more complex scenes.
Diffstat (limited to 'source/gameengine/Converter/KX_ConvertControllers.cpp')
-rw-r--r--source/gameengine/Converter/KX_ConvertControllers.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/gameengine/Converter/KX_ConvertControllers.cpp b/source/gameengine/Converter/KX_ConvertControllers.cpp
index 769abd01ce0..5d3d0f33bec 100644
--- a/source/gameengine/Converter/KX_ConvertControllers.cpp
+++ b/source/gameengine/Converter/KX_ConvertControllers.cpp
@@ -157,7 +157,7 @@ void BL_ConvertControllers(
SCA_PythonController* pyctrl = new SCA_PythonController(gameobj, pycont->mode);
gamecontroller = pyctrl;
#ifdef WITH_PYTHON
-
+ PyGILState_STATE gstate = PyGILState_Ensure();
pyctrl->SetNamespace(converter->GetPyNamespace());
if (pycont->mode==SCA_PythonController::SCA_PYEXEC_SCRIPT) {
@@ -186,6 +186,7 @@ void BL_ConvertControllers(
}
}
+ PyGILState_Release(gstate);
#endif // WITH_PYTHON
break;
@@ -218,6 +219,7 @@ void BL_ConvertControllers(
converter->RegisterGameController(gamecontroller, bcontr);
#ifdef WITH_PYTHON
+ PyGILState_STATE gstate = PyGILState_Ensure();
if (bcontr->type==CONT_PYTHON) {
SCA_PythonController *pyctrl= static_cast<SCA_PythonController*>(gamecontroller);
/* not strictly needed but gives syntax errors early on and
@@ -232,6 +234,8 @@ void BL_ConvertControllers(
// pyctrl->Import();
}
}
+
+ PyGILState_Release(gstate);
#endif // WITH_PYTHON
//done with gamecontroller