diff options
author | Willian Padovani Germano <wpgermano@gmail.com> | 2008-02-24 19:19:39 +0300 |
---|---|---|
committer | Willian Padovani Germano <wpgermano@gmail.com> | 2008-02-24 19:19:39 +0300 |
commit | 87dd4809edd4c6b1c13746ad54e6f4614c515e0a (patch) | |
tree | de4d3226c9649b6753a30e7c81f74593020e88c2 /source/blender/python/BPY_interface.c | |
parent | 7098c1b93cf8c4c32110781fcf87ffb0cea896e8 (diff) |
== PyNodes ==
Small update to where a PyGILState_Ensure() call is made.
--
Let me use this commit to mention a couple things related to this change to make Python thread-safe in Blender:
1) This page explains the changes: http://wiki.blender.org/index.php/BlenderDev/BPythonAPI/Threads
2) If you experience hangs (deadlocks) when running anything related to Python in Blender, the related part in the code may need a proper Ensure/Release block, as explained in the above link.
From Joshua (aligorith)'s previous commit to this file:
"* various problems related to gilstate calls being added in strange places (could someone familiar with python double check that they're in the right places now)?"
I checked the two places you fixed, second one is ok, the first one needed to be before the call to create a py dict -- done. Thanks for catching them!
Diffstat (limited to 'source/blender/python/BPY_interface.c')
-rw-r--r-- | source/blender/python/BPY_interface.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/python/BPY_interface.c b/source/blender/python/BPY_interface.c index 1aa8c7042b1..75ed8e086d9 100644 --- a/source/blender/python/BPY_interface.c +++ b/source/blender/python/BPY_interface.c @@ -1771,12 +1771,12 @@ void BPY_pyconstraint_settings(void *arg1, void *arg2) if (!con->text) return; if (con->flag & PYCON_SCRIPTERROR) return; + gilstate = PyGILState_Ensure(); + globals = CreateGlobalDictionary(); idprop = BPy_Wrap_IDProperty( NULL, con->prop, NULL); - gilstate = PyGILState_Ensure(); - retval = RunPython(con->text, globals); if (retval == NULL) { |