[Bf-blender-cvs] [edb80a801d5] blender2.8: Fix crash activating the HUD w/o an active region

Campbell Barton noreply at git.blender.org
Wed Jun 20 11:43:40 CEST 2018


Commit: edb80a801d5f174ba80edd06772e86aff92d3e4f
Author: Campbell Barton
Date:   Wed Jun 20 11:42:41 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBedb80a801d5f174ba80edd06772e86aff92d3e4f

Fix crash activating the HUD w/o an active region

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

M	source/blender/editors/interface/interface_region_hud.c

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

diff --git a/source/blender/editors/interface/interface_region_hud.c b/source/blender/editors/interface/interface_region_hud.c
index 569f50a9c75..1a49010ad9d 100644
--- a/source/blender/editors/interface/interface_region_hud.c
+++ b/source/blender/editors/interface/interface_region_hud.c
@@ -329,7 +329,10 @@ void ED_area_type_hud_ensure(bContext *C, ScrArea *sa)
 
 	/* We shouldn't need to do this every time :S */
 	/* XXX, this is evil! - it also makes the menu show on first draw. :( */
+	ARegion *ar_prev = CTX_wm_region(C);
+	CTX_wm_region_set((bContext *)C, ar);
 	hud_region_layout(C, ar);
+	CTX_wm_region_set((bContext *)C, ar_prev);
 }
 
 /** \} */



More information about the Bf-blender-cvs mailing list