summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2014-08-01 01:00:11 (GMT)
committerKevin Walzer <kw@codebykevin.com>2014-08-01 01:00:11 (GMT)
commit641b317cbd760a8d3676fff03a903c8c294410d0 (patch)
tree9ab24e36b52733a61c3f120b28ddf61cb46dddaf /macosx
parent17e61e6ace9cd71343e3e2d6be7914740fea3d6d (diff)
downloadtk-641b317cbd760a8d3676fff03a903c8c294410d0.zip
tk-641b317cbd760a8d3676fff03a903c8c294410d0.tar.gz
tk-641b317cbd760a8d3676fff03a903c8c294410d0.tar.bz2
Fix for font configure crash on OS X, thanks to rob@bitkeeper.com for the patch
Diffstat (limited to 'macosx')
-rw-r--r--macosx/tkMacOSXFont.c2
-rw-r--r--macosx/tkMacOSXMenu.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c
index d800ae5..4c8ac30 100644
--- a/macosx/tkMacOSXFont.c
+++ b/macosx/tkMacOSXFont.c
@@ -293,7 +293,7 @@ InitFont(
[NSNumber numberWithInt:fmPtr->fixed ? 0 : 1],
NSLigatureAttributeName,
[NSNumber numberWithDouble:kern], NSKernAttributeName, nil];
- fontPtr->nsAttributes = TkMacOSXMakeUncollectableAndRetain(nsAttributes);
+ fontPtr->nsAttributes = TkMacOSXMakeUncollectableAndRetain(nsAttributes);
#undef nCh
}
diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c
index 83ad47a..313a5cf 100644
--- a/macosx/tkMacOSXMenu.c
+++ b/macosx/tkMacOSXMenu.c
@@ -684,6 +684,9 @@ TkpConfigureMenuEntry(
NSArray *itemArray = [submenu itemArray];
for (NSMenuItem *item in itemArray) {
TkMenuEntry *submePtr = menuRefPtr->menuPtr->entries[i];
+ /* Work around an apparent bug where itemArray can have
+ more items than the menu's entries[] array. */
+ if (i >= menuRefPtr->menuPtr->numEntries) break;
[item setEnabled: !(submePtr->state == ENTRY_DISABLED)];
i++;
}