From 4a0c3e2a12498c0769eabf9ee1dab30d01fe658d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 2 Oct 2011 21:21:14 +0000 Subject: fix [#28784] CRASHER on load with load_post handler also fix pacman package build spec. --- source/blender/windowmanager/intern/wm_files.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 76ebeaa9f21..bf5b60d691f 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -412,6 +412,10 @@ void WM_read_file(bContext *C, const char *filepath, ReportList *reports) BPY_app_handlers_reset(); BPY_modules_load_user(C); #endif + + /* important to do before NULL'ing the context */ + BLI_exec_cb(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_POST); + CTX_wm_window_set(C, NULL); /* exits queues */ #if 0 /* gives popups on windows but not linux, bug in report API but disable for now to stop users getting annoyed */ @@ -429,8 +433,6 @@ void WM_read_file(bContext *C, const char *filepath, ReportList *reports) // XXX undo_editmode_clear(); BKE_reset_undo(); BKE_write_undo(C, "original"); /* save current state */ - - BLI_exec_cb(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_POST); } else if(retval == BKE_READ_EXOTIC_OK_OTHER) BKE_write_undo(C, "Import file"); -- cgit v1.2.3