mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-07 19:49:41 +08:00
Fix bad deallocation of context menus
This commit is contained in:
parent
26a291dbee
commit
e6491bcbb7
@ -62,6 +62,11 @@ int freeContextMenu(void *const context, struct hashmap_element_s *const e) {
|
|||||||
|
|
||||||
void DeleteContextMenuStore(ContextMenuStore* store) {
|
void DeleteContextMenuStore(ContextMenuStore* store) {
|
||||||
|
|
||||||
|
// Guard against NULLs
|
||||||
|
if( store == NULL ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Delete context menus
|
// Delete context menus
|
||||||
if( hashmap_num_entries(&store->contextMenuStore) > 0 ) {
|
if( hashmap_num_entries(&store->contextMenuStore) > 0 ) {
|
||||||
if (0 != hashmap_iterate_pairs(&store->contextMenuStore, freeContextMenu, NULL)) {
|
if (0 != hashmap_iterate_pairs(&store->contextMenuStore, freeContextMenu, NULL)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user