[Bf-blender-cvs] [a8e7d15fa0f] lanpr-under-gp: Fix use after free deleting object with modifier panels visible

Hans Goudey noreply at git.blender.org
Fri Oct 2 07:40:27 CEST 2020


Commit: a8e7d15fa0fcad4bc58b4a9261788da6fcd8bb3d
Author: Hans Goudey
Date:   Tue Sep 29 17:19:57 2020 -0500
Branches: lanpr-under-gp
https://developer.blender.org/rBa8e7d15fa0fcad4bc58b4a9261788da6fcd8bb3d

Fix use after free deleting object with modifier panels visible

It's necessary to check if the panels are active before accessing their
data. Thanks to @ankitm for reporting this.

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

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

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

diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index a23929ad789..66b9ec8685c 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -524,9 +524,11 @@ void UI_panel_set_expand_from_list_data(const bContext *C, Panel *panel)
 static void region_panels_set_expansion_from_list_data(const bContext *C, ARegion *region)
 {
   LISTBASE_FOREACH (Panel *, panel, &region->panels) {
-    PanelType *panel_type = panel->type;
-    if (panel_type != NULL && panel->type->flag & PNL_INSTANCED) {
-      UI_panel_set_expand_from_list_data(C, panel);
+    if (panel->runtime_flag & PANEL_ACTIVE) {
+      PanelType *panel_type = panel->type;
+      if (panel_type != NULL && panel->type->flag & PNL_INSTANCED) {
+        UI_panel_set_expand_from_list_data(C, panel);
+      }
     }
   }
 }



More information about the Bf-blender-cvs mailing list