diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-02-01 05:54:29 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-02-01 05:54:29 +0300 |
commit | b17bbf9d9548a608d865a25c629e142f12ce762a (patch) | |
tree | eeba3478ada3f0d10c20774e57b2fe1e9a18c6f1 /source/blender/windowmanager/intern/wm_files.c | |
parent | 339d3bf05f6b34064ed9e0c5016b315e0a1e5cf9 (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/intern/wm_files.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 8 |
1 files changed, 6 insertions, 2 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; } |