diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-01-09 10:00:33 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-01-09 10:00:33 +0400 |
commit | 9b5a2084bc1ca8f330faeb601d2b3c65efa98f3d (patch) | |
tree | 5047c0b51307ecc6a16a3d179d2ee82e7a7ffcb6 /source/blender/makesrna/intern/rna_ui.c | |
parent | cecbb3498b245fbf2226c967001c4ab40b1c7b87 (diff) |
avoid having dangling panel pointers in the interface, unregistering addons could leave the interface pointing to freed memory.
Diffstat (limited to 'source/blender/makesrna/intern/rna_ui.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_ui.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index 137ffecac9a..cae9673906e 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -165,8 +165,9 @@ static void panel_draw_header(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) { + wmWindowManager *wm; ARegionType *art; PanelType *pt = RNA_struct_blender_type_get(type); @@ -174,6 +175,10 @@ static void rna_Panel_unregister(Main *UNUSED(bmain), StructRNA *type) return; if (!(art = region_type_find(NULL, pt->space_type, pt->region_type))) return; + + for (wm = bmain->wm.first; wm; wm = wm->id.next) { + uiPanelClearType(wm, art, pt); + } RNA_struct_free_extension(type, &pt->ext); |