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:
authorCampbell Barton <ideasman42@gmail.com>2013-01-09 10:00:33 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-01-09 10:00:33 +0400
commit9b5a2084bc1ca8f330faeb601d2b3c65efa98f3d (patch)
tree5047c0b51307ecc6a16a3d179d2ee82e7a7ffcb6 /source/blender/makesrna/intern/rna_ui.c
parentcecbb3498b245fbf2226c967001c4ab40b1c7b87 (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.c7
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);