summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorculler <culler>2019-10-10 17:51:21 (GMT)
committerculler <culler>2019-10-10 17:51:21 (GMT)
commitdad21abbf04919fb0504268f174a05eb84b80825 (patch)
tree3cdbf030135d0c8a28e7b762811fe47f4276308b
parent289b795efe26e23eefb5a04115779c0c78fcb933 (diff)
downloadtk-dad21abbf04919fb0504268f174a05eb84b80825.zip
tk-dad21abbf04919fb0504268f174a05eb84b80825.tar.gz
tk-dad21abbf04919fb0504268f174a05eb84b80825.tar.bz2
Fix macOS crash caused by deactivating a menu while it is being deleted.
-rw-r--r--macosx/tkMacOSXMenu.c5
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);
}
}