5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-04 09:53:03 +08:00

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
No known key found for this signature in database
GPG Key ID: 33DAF7BB90A58405

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)) {