Fix T93523: Memory leak in Menu Search

Fixes a memory leak introduced by D13225.
Caused by not freeing the hash-map in some cases.

Differential Revision: https://developer.blender.org/D13432
This commit is contained in:
Erik Abrahamsson 2021-12-09 01:48:11 +01:00
parent be2213472f
commit 3753a0b72b
Notes: blender-bot 2023-02-14 11:01:33 +01:00
Referenced by issue #93523, Not freed memory blocks in Menu Search
1 changed files with 6 additions and 0 deletions

View File

@ -45,6 +45,7 @@
#include "DNA_view3d_types.h"
#include "DNA_workspace_types.h"
#include "BLI_ghash.h"
#include "BLI_listbase.h"
#include "BLI_math_vector.h"
#include "BLI_mempool.h"
@ -671,6 +672,11 @@ void BKE_area_region_free(SpaceType *st, ARegion *region)
region_free_gizmomap_callback(region->gizmo_map);
}
if (region->runtime.block_name_map != NULL) {
BLI_ghash_free(region->runtime.block_name_map, NULL, NULL);
region->runtime.block_name_map = NULL;
}
BLI_freelistN(&region->ui_lists);
BLI_freelistN(&region->ui_previews);
BLI_freelistN(&region->panels_category);