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.
This commit is contained in:
Hans Goudey 2020-09-29 17:19:57 -05:00
parent 23363ca084
commit e1e9b5e661
1 changed files with 5 additions and 3 deletions

View File

@ -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);
}
}
}
}