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:
authorBastien Montagne <montagne29@wanadoo.fr>2016-03-01 14:40:04 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-03-01 14:44:38 +0300
commita0db3c3966caf837840380dd9525d2b098123ba7 (patch)
treea3282b0cee9aee92c6fc3681d576fbda2c5993b0 /source/blender
parent607d916f503a13d542cfa65c4ff505e913679df7 (diff)
Fix (unreported) crash when opening a file from splash screen when 'load UI' option is disabled.
See rB935e241fa6ea095493 for details of the issue, but first fix caused regression T47632. So for now handling the issue in a localized way, this is not a real solution (since this could happen in other cases), but will do for 2.77. This commit is to be backported to 2.77.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/windowmanager/intern/wm_files.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 3e2976bb8e0..ce722c732e6 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -161,6 +161,13 @@ static void wm_window_match_init(bContext *C, ListBase *wmlist)
/* reset active window */
CTX_wm_window_set(C, active_win);
+ /* XXX Hack! We have to clear context menu here, because removing all modalhandlers above frees the active menu
+ * (at least, in the 'startup splash' case), causing use-after-free error in later handling of the button
+ * callbacks in UI code (see ui_apply_but_funcs_after()).
+ * Tried solving this by always NULL-ing context's menu when setting wm/win/etc., but it broke popups refreshing
+ * (see T47632), so for now just handling this specific case here. */
+ CTX_wm_menu_set(C, NULL);
+
ED_editors_exit(C);
/* just had return; here from r12991, this code could just get removed?*/