fix [#28784] CRASHER on load with load_post handler
authorCampbell Barton <ideasman42@gmail.com>
Sun, 2 Oct 2011 21:21:14 +0000 (21:21 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 2 Oct 2011 21:21:14 +0000 (21:21 +0000)
also fix pacman package build spec.

build_files/package_spec/pacman/PKGBUILD
source/blender/windowmanager/intern/wm_files.c

index f7dbf1782ce1144929b2848929eb5297f99e9cb8..0f070f3d5583e9c0e6628adf03f71fd4bc79129f 100644 (file)
@@ -4,7 +4,7 @@
 blender_srcdir=$(dirname $startdir)"/../.."
 # value may be formatted: 35042:35051M
 blender_revision=$(svnversion $blender_srcdir | cut -d: -f2 | awk '{print $3}')
-blender_version=$(grep BLENDER_VERSION $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}')
+blender_version=$(grep "BLENDER_VERSION\s" $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}')
 blender_version=$(expr $blender_version / 100).$(expr $blender_version % 100)  # 256 -> 2.56
 blender_version_char=$(sed -ne 's/.*BLENDER_VERSION_CHAR.*\([a-z]\)$/\1/p' $blender_srcdir/source/blender/blenkernel/BKE_blender.h)
 # blender_subversion=$(grep BLENDER_SUBVERSION $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}')
index 76ebeaa9f218b111e5723ee0e8117d1eddcfdd76..bf5b60d691fcfcbcea23503043e0371c9d7d9cef 100644 (file)
@@ -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");