Added PyGILState_Ensure and PyGILState_Release funcs around module reloading.

Without them blender would crash when reloading scripts.
This commit is contained in:
2008-02-25 18:35:35 +00:00
parent 6f1b9eb9ac
commit 3dd622b2b4

View File

@@ -408,7 +408,8 @@ void BPY_rebuild_syspath( void )
PyObject *mod, *dict, *syspath;
char dirpath[FILE_MAX];
char *sdir = NULL;
PyGILState_STATE gilstate = PyGILState_Ensure();
mod = PyImport_ImportModule( "sys" );
if (!mod) {
printf("error: could not import python sys module. some modules may not import.\n");
@@ -454,7 +455,7 @@ void BPY_rebuild_syspath( void )
}
Py_DECREF(mod);
PyGILState_Release(gilstate);
}
/****************************************************************************