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
committerSergey Sharybin <sergey.vfx@gmail.com>2016-03-04 19:11:57 +0300
commit6a97b9c4a2c5619016715c803f5c032c20f3961b (patch)
treecd322fb2d39b3c0c7ad6f0b7db0f0ff436dc3342
parent01485b389a1ba9cbe383c75239a28aae43b09a9b (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.
-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?*/