From e783fddc0167eeb58bd69ed08ff31d0746772ad6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 22 Jun 2016 03:29:25 +1000 Subject: Fix T48700: Crash when window creation fails Check if Python is initialized before calling BPY_python_end. --- source/blender/windowmanager/intern/wm_init_exit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/windowmanager/intern') diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 6300d2ed3c7..917e2bf5913 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 */ -- cgit v1.2.3