From db1a04313c3223250b6e6ae1b3652f0a134b8239 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 6 Oct 2018 20:56:08 +0200 Subject: Fix crash unregistering parent panel before children. This caused crashes with addon enabling/disabling and template loading. --- source/blender/makesrna/intern/rna_ui.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/blender/makesrna/intern/rna_ui.c') diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index 4af658da1aa..333181b3593 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -204,6 +204,11 @@ static void rna_Panel_unregister(Main *UNUSED(bmain), StructRNA *type) WM_paneltype_remove(pt); + for (LinkData *link = pt->children.first; link; link = link->next) { + PanelType *child_pt = link->data; + child_pt->parent = NULL; + } + BLI_freelistN(&pt->children); BLI_freelinkN(&art->paneltypes, pt); -- cgit v1.2.3