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:
authorHans Goudey <h.goudey@me.com>2020-09-13 02:47:40 +0300
committerHans Goudey <h.goudey@me.com>2020-09-13 02:47:40 +0300
commit43533f4269b71e2f1304713932d2917604e276f8 (patch)
tree57bfed4946ed0d4a2e4232e020fdfd922aa36927
parentcd35233ea72f2a524fd92df27ae3cb5d0ab2603e (diff)
Property Search: Fix memory leak
-rw-r--r--source/blender/editors/interface/interface_layout.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index e36a427e187..92c4c6228de 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -5125,6 +5125,8 @@ void uiLayoutRootSetSearchOnly(uiLayout *layout, bool search_only)
/** \name Block Layout Search Filtering
* \{ */
+static void layout_root_free(uiLayoutRoot *root);
+
// #define PROPERTY_SEARCH_USE_TOOLTIPS
static bool block_search_panel_label_matches(const uiBlock *block)
@@ -5163,7 +5165,7 @@ static void block_search_remove_search_only_roots(uiBlock *block)
if (root->search_only) {
layout_free_and_hide_buttons(root->layout);
BLI_remlink(&block->layouts, root);
- MEM_freeN(root);
+ layout_root_free(root);
}
}
}
@@ -5546,8 +5548,6 @@ static void ui_layout_free(uiLayout *layout)
static void layout_root_free(uiLayoutRoot *root)
{
- ui_layout_free(root->layout);
-
LISTBASE_FOREACH_MUTABLE (uiButtonGroup *, button_group, &root->button_groups) {
button_group_free(button_group);
}
@@ -5750,6 +5750,7 @@ void UI_block_layout_resolve(uiBlock *block, int *r_x, int *r_y)
/* NULL in advance so we don't interfere when adding button */
ui_layout_end(block, root->layout, r_x, r_y);
+ ui_layout_free(root->layout);
layout_root_free(root);
}