[Bf-blender-cvs] [6a97b9c] blender-v2.77-release: Fix (unreported) crash when opening a file from splash screen when 'load UI' option is disabled.

Bastien Montagne noreply at git.blender.org
Fri Mar 4 17:35:56 CET 2016


Commit: 6a97b9c4a2c5619016715c803f5c032c20f3961b
Author: Bastien Montagne
Date:   Tue Mar 1 12:40:04 2016 +0100
Branches: blender-v2.77-release
https://developer.blender.org/rB6a97b9c4a2c5619016715c803f5c032c20f3961b

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.

===================================================================

M	source/blender/windowmanager/intern/wm_files.c

===================================================================

diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 3e2976b..ce722c7 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?*/




More information about the Bf-blender-cvs mailing list