Fix leak in UI Panels

Switching screens quickly didn't free the panels activedata.
This commit is contained in:
Campbell Barton 2015-09-19 17:38:36 +10:00 committed by Sergey Sharybin
parent 139cab0937
commit aabb8db753
1 changed files with 10 additions and 1 deletions

View File

@ -308,7 +308,16 @@ void BKE_area_region_free(SpaceType *st, ARegion *ar)
ar->v2d.tab_offset = NULL;
}
BLI_freelistN(&ar->panels);
if (!BLI_listbase_is_empty(&ar->panels)) {
Panel *pa, *pa_next;
for (pa = ar->panels.first; pa; pa = pa_next) {
pa_next = pa->next;
if (pa->activedata) {
MEM_freeN(pa->activedata);
}
MEM_freeN(pa);
}
}
for (uilst = ar->ui_lists.first; uilst; uilst = uilst->next) {
if (uilst->dyn_data) {