[Bf-blender-cvs] [71c6af4d599] property-search-ui: Property Search: Solve memory leak

Hans Goudey noreply at git.blender.org
Tue Jul 7 19:21:42 CEST 2020


Commit: 71c6af4d5990fd719acc700cdd973a9821f0c7f7
Author: Hans Goudey
Date:   Tue Jul 7 13:21:23 2020 -0400
Branches: property-search-ui
https://developer.blender.org/rB71c6af4d5990fd719acc700cdd973a9821f0c7f7

Property Search: Solve memory leak

===================================================================

M	source/blender/editors/interface/interface_layout.c

===================================================================

diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 3557bdd2cb5..659f8ab0625 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -5400,10 +5400,11 @@ static bool ui_block_layout_search_clean(uiBlock *block)
     bool empty = ui_layout_search_clean_recursive(root->layout);
     all_roots_empty &= empty;
 
-    /* Empty roots should have all sublayouts freed, but they needs to be freed too. */
+    /* If the root is empty, make sure it is freed along with all of its sublayouts. */
     if (empty) {
       BLI_assert(BLI_findindex(&block->layouts, root) != -1);
       BLI_remlink(&block->layouts, root);
+      ui_layout_free_hide_buttons(root->layout);
       MEM_freeN(root);
     }
   }
@@ -5498,7 +5499,6 @@ static bool ui_block_search_layout(uiBlock *block)
       ui_layout_free_hide_buttons(root->layout);
       BLI_remlink(&block->layouts, root);
       MEM_freeN(root);
-      MEM_freeN(root->layout);
     }
   }



More information about the Bf-blender-cvs mailing list