fix [#28672] Blender segfault after exiting a game that was opened with
[blender.git] / source / blender / python / intern / bpy_interface.c
index e5bfc1d633ff04fe89d97cc6a7168c559272e7f6..87edf9303ef3dc0544af70c56cf2f13bfd1a2aa5 100644 (file)
@@ -30,7 +30,7 @@
  
 /* grr, python redefines */
 #ifdef _POSIX_C_SOURCE
-#undef _POSIX_C_SOURCE
+#  undef _POSIX_C_SOURCE
 #endif
 
 #include <Python.h>
@@ -241,6 +241,8 @@ void BPY_python_start(int argc, const char **argv)
        
        pyrna_alloc_types();
 
+       BPY_atexit_init(); /* this can init any time */
+
 #ifndef WITH_PYTHON_MODULE
        py_tstate= PyGILState_GetThisThreadState();
        PyEval_ReleaseThread(py_tstate);