diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-10-13 19:44:27 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-10-13 19:45:40 +0400 |
commit | cf38b933f3408b7f45d0e0e378d8aefb23bd4f6c (patch) | |
tree | db3e3fd24c938054b0130ee0ff8c71e8a04a1035 /source/blender/python/intern | |
parent | e72d8b4711ff50b199075c0b469c305b3554d5ef (diff) |
Fix T42005: Reset py-handlers could crash
Wasn't acquiring the GIL.
Diffstat (limited to 'source/blender/python/intern')
-rw-r--r-- | source/blender/python/intern/bpy_app_handlers.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_app_handlers.c b/source/blender/python/intern/bpy_app_handlers.c index 41ca2d49ed6..44da322efc0 100644 --- a/source/blender/python/intern/bpy_app_handlers.c +++ b/source/blender/python/intern/bpy_app_handlers.c @@ -240,8 +240,11 @@ PyObject *BPY_app_handlers_struct(void) void BPY_app_handlers_reset(const short do_all) { + PyGILState_STATE gilstate; int pos = 0; + gilstate = PyGILState_Ensure(); + if (do_all) { for (pos = 0; pos < BLI_CB_EVT_TOT; pos++) { /* clear list */ @@ -279,6 +282,8 @@ void BPY_app_handlers_reset(const short do_all) Py_DECREF(perm_id_str); } + + PyGILState_Release(gilstate); } /* the actual callback - not necessarily called from py */ |