From b04b8fd0e85f0504bd726e52a5f94413e61012c7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 1 Oct 2012 14:14:21 +0000 Subject: fix for crash found when attempting to setup testing environment to find crashes :) scripts that have `Register` enabled and load another blend file would crash blender. --- source/blender/python/intern/bpy_interface.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 85f6163c721..d5ef6905b51 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -678,6 +678,11 @@ void BPY_modules_load_user(bContext *C) else { Py_DECREF(module); } + + /* check if the script loaded a new file */ + if (bmain != CTX_data_main(C)) { + break; + } } } } -- cgit v1.2.3