Fix bad deallocation of context menus

This commit is contained in:
Lea Anthony
2021-01-11 07:03:59 +11:00
parent 26a291dbee
commit e6491bcbb7

View File

@@ -62,6 +62,11 @@ int freeContextMenu(void *const context, struct hashmap_element_s *const e) {
void DeleteContextMenuStore(ContextMenuStore* store) {
// Guard against NULLs
if( store == NULL ) {
return;
}
// Delete context menus
if( hashmap_num_entries(&store->contextMenuStore) > 0 ) {
if (0 != hashmap_iterate_pairs(&store->contextMenuStore, freeContextMenu, NULL)) {