diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_ui.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_ui.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index 8ce6ab957b8..d87b3a6386e 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -65,8 +65,6 @@ const EnumPropertyItem rna_enum_uilist_layout_type_items[] = { #ifdef RNA_RUNTIME -# include <assert.h> - # include "MEM_guardedalloc.h" # include "RNA_access.h" @@ -182,6 +180,17 @@ static void panel_draw_header_preset(const bContext *C, Panel *panel) RNA_parameter_list_free(&list); } +static void panel_type_clear_recursive(Panel *panel, const PanelType *type) +{ + if (panel->type == type) { + panel->type = NULL; + } + + LISTBASE_FOREACH (Panel *, child_panel, &panel->children) { + panel_type_clear_recursive(child_panel, type); + } +} + static void rna_Panel_unregister(Main *bmain, StructRNA *type) { ARegionType *art; @@ -222,9 +231,7 @@ static void rna_Panel_unregister(Main *bmain, StructRNA *type) LISTBASE_FOREACH (ARegion *, region, regionbase) { if (region->type == art) { LISTBASE_FOREACH (Panel *, panel, ®ion->panels) { - if (panel->type == pt) { - panel->type = NULL; - } + panel_type_clear_recursive(panel, pt); } } /* The unregistered panel might have had a template that added instanced panels, @@ -993,7 +1000,7 @@ static void rna_Menu_bl_description_set(PointerRNA *ptr, const char *value) BLI_strncpy(str, value, RNA_DYN_DESCR_MAX); /* utf8 already ensured */ } else { - assert(!"setting the bl_description on a non-builtin menu"); + BLI_assert(!"setting the bl_description on a non-builtin menu"); } } |