5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-04 02:51:56 +08:00

[mac] Fix memory leak with menu item callback data

This commit is contained in:
Lea Anthony 2021-06-29 15:49:44 +10:00
parent 2fbc63b458
commit e04db8775f
No known key found for this signature in database
GPG Key ID: 33DAF7BB90A58405

View File

@ -85,7 +85,11 @@ void DeleteMenu(Menu *menu) {
menu->processedMenu = NULL;
}
// Release the vector memory
// Release the callback data memory + vector
int i; MenuItemCallbackData* callbackData;
vec_foreach(&menu->callbackDataCache, callbackData, i) {
free(callbackData);
}
vec_deinit(&menu->callbackDataCache);
// Free nsmenu if we have it