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, 18 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index 1e5f1dc20ec..a2339a815dc 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -180,7 +180,7 @@ static void panel_draw_header_preset(const bContext *C, Panel *pnl) RNA_parameter_list_free(&list); } -static void rna_Panel_unregister(Main *UNUSED(bmain), StructRNA *type) +static void rna_Panel_unregister(Main *bmain, StructRNA *type) { ARegionType *art; PanelType *pt = RNA_struct_blender_type_get(type); @@ -210,6 +210,23 @@ static void rna_Panel_unregister(Main *UNUSED(bmain), StructRNA *type) BLI_freelistN(&pt->children); BLI_freelinkN(&art->paneltypes, pt); + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { + for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { + for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { + ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase; + for (ARegion *region = regionbase->first; region; region = region->next) { + if (region->type == art) { + for (Panel *pa = region->panels.first; pa; pa = pa->next) { + if (pa->type == pt) { + pa->type = NULL; + } + } + } + } + } + } + } + /* update while blender is running */ WM_main_add_notifier(NC_WINDOW, NULL); } |