diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-03-01 14:40:04 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-03-01 14:44:38 +0300 |
commit | a0db3c3966caf837840380dd9525d2b098123ba7 (patch) | |
tree | a3282b0cee9aee92c6fc3681d576fbda2c5993b0 | |
parent | 607d916f503a13d542cfa65c4ff505e913679df7 (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.c | 7 |
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?*/ |