Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-02-01 05:54:29 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-02-01 05:54:29 +0300
commitb17bbf9d9548a608d865a25c629e142f12ce762a (patch)
treeeeba3478ada3f0d10c20774e57b2fe1e9a18c6f1 /source/blender/windowmanager
parent339d3bf05f6b34064ed9e0c5016b315e0a1e5cf9 (diff)
fix for 2 segfaults running in background mode.
- operators which reload G.main would crash blender if called from python and then accessed bpy.data.* - WM_read_homefile_exec was setting the contexts Scene to NULL as a signal for the event system, this didnt work in background mode, crashing when property update functions expected scene to be set.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_files.c8
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c4
2 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 80b88309883..644320b0566 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -429,9 +429,13 @@ int WM_read_homefile(bContext *C, ReportList *reports, short from_memory)
BPY_modules_load_user(C);
}
#endif
-
+
WM_event_add_notifier(C, NC_WM|ND_FILEREAD, NULL);
- CTX_wm_window_set(C, NULL); /* exits queues */
+
+ /* in background mode the scene will stay NULL */
+ if(!G.background) {
+ CTX_wm_window_set(C, NULL); /* exits queues */
+ }
return TRUE;
}
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 5aa2f6c1c50..1b602b167c7 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -1350,7 +1350,7 @@ static void WM_OT_read_homefile(wmOperatorType *ot)
ot->invoke= WM_operator_confirm;
ot->exec= WM_read_homefile_exec;
- ot->poll= WM_operator_winactive;
+ /* ommit poll to run in background mode */
}
static void WM_OT_read_factory_settings(wmOperatorType *ot)
@@ -1361,7 +1361,7 @@ static void WM_OT_read_factory_settings(wmOperatorType *ot)
ot->invoke= WM_operator_confirm;
ot->exec= WM_read_homefile_exec;
- ot->poll= WM_operator_winactive;
+ /* ommit poll to run in background mode */
}
/* *************** open file **************** */