From b17bbf9d9548a608d865a25c629e142f12ce762a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 1 Feb 2011 02:54:29 +0000 Subject: 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. --- source/blender/windowmanager/intern/wm_files.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source/blender/windowmanager/intern/wm_files.c') 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; } -- cgit v1.2.3