diff options
author | culler <culler> | 2019-10-10 17:51:21 (GMT) |
---|---|---|
committer | culler <culler> | 2019-10-10 17:51:21 (GMT) |
commit | dad21abbf04919fb0504268f174a05eb84b80825 (patch) | |
tree | 3cdbf030135d0c8a28e7b762811fe47f4276308b /macosx | |
parent | 289b795efe26e23eefb5a04115779c0c78fcb933 (diff) | |
download | tk-dad21abbf04919fb0504268f174a05eb84b80825.zip tk-dad21abbf04919fb0504268f174a05eb84b80825.tar.gz tk-dad21abbf04919fb0504268f174a05eb84b80825.tar.bz2 |
Fix macOS crash caused by deactivating a menu while it is being deleted.
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/tkMacOSXMenu.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index 3b61c47..7d2a073 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -1561,7 +1561,10 @@ TkMacOSXClearMenubarActive(void) if (mainMenu && [mainMenu isKindOfClass:[TKMenu class]]) { TkMenu *menuPtr = [(TKMenu *) mainMenu tkMenu]; - if (menuPtr && menuPtr->numEntries && menuPtr->entries) { + if (menuPtr && + !(menuPtr->menuFlags & MENU_DELETION_PENDING) && + menuPtr->numEntries > 0 && + menuPtr->entries != NULL) { RecursivelyClearActiveMenu(menuPtr); } } |