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:
authorHans Goudey <h.goudey@me.com>2020-09-30 01:19:57 +0300
committerHans Goudey <h.goudey@me.com>2020-09-30 01:19:57 +0300
commite1e9b5e661b41e86030a50a32131e6e64ea73e86 (patch)
tree6f33357813744dea44f67ca70d495da72d13320b
parent23363ca08498b4c9d05321186f608f71b8489406 (diff)
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.
-rw-r--r--source/blender/editors/interface/interface_panel.c8
1 files changed, 5 insertions, 3 deletions
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);
+ }
}
}
}