[Bf-blender-cvs] [e783fdd] master: Fix T48700: Crash when window creation fails

Campbell Barton noreply at git.blender.org
Tue Jun 21 20:11:48 CEST 2016


Commit: e783fddc0167eeb58bd69ed08ff31d0746772ad6
Author: Campbell Barton
Date:   Wed Jun 22 03:29:25 2016 +1000
Branches: master
https://developer.blender.org/rBe783fddc0167eeb58bd69ed08ff31d0746772ad6

Fix T48700: Crash when window creation fails

Check if Python is initialized before calling BPY_python_end.

===================================================================

M	source/blender/windowmanager/intern/wm_init_exit.c

===================================================================

diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index 6300d2e..917e2bf 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -533,7 +533,7 @@ void WM_exit_ext(bContext *C, const bool do_python)
 
 #ifdef WITH_PYTHON
 	/* option not to close python so we can use 'atexit' */
-	if (do_python) {
+	if (do_python && ((C == NULL) || CTX_py_init_get(C))) {
 		/* XXX - old note */
 		/* before BKE_blender_free so py's gc happens while library still exists */
 		/* needed at least for a rare sigsegv that can happen in pydrivers */




More information about the Bf-blender-cvs mailing list