summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwolfsuit <wolfsuit>2002-08-26 21:57:44 (GMT)
committerwolfsuit <wolfsuit>2002-08-26 21:57:44 (GMT)
commit87c8b231c8ceda0f5f252005298c67175413eb75 (patch)
tree32bb226a95acd8dcf96811f2ab907f461b229bc3
parente795efbb63cbdcc16bed5271bead4c51327f3b04 (diff)
downloadtk-87c8b231c8ceda0f5f252005298c67175413eb75.zip
tk-87c8b231c8ceda0f5f252005298c67175413eb75.tar.gz
tk-87c8b231c8ceda0f5f252005298c67175413eb75.tar.bz2
08/26/2002 Jim Ingham < jingham@apple.com>
tkMacOSXMenu.c: In ReconfigureIndividualMenu, guard against the CFStringFromCString returning NULL. In this case, insert "<error>" for the menu item text, for want of a better thing to do...
-rw-r--r--macosx/tkMacOSXMenu.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c
index 22934d4..731fcad 100644
--- a/macosx/tkMacOSXMenu.c
+++ b/macosx/tkMacOSXMenu.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXMenu.c,v 1.1.2.7 2002/07/19 09:22:34 vincentdarley Exp $
+ * RCS: @(#) $Id: tkMacOSXMenu.c,v 1.1.2.8 2002/08/26 21:57:44 wolfsuit Exp $
*/
#include "tkMacOSXInt.h"
#include "tkMenuButton.h"
@@ -1079,8 +1079,14 @@ ReconfigureIndividualMenu(
cf = CFStringCreateWithCString(NULL,
Tcl_DStringValue(&itemTextDString), kCFStringEncodingUTF8);
AppendMenu(macMenuHdl, "\px");
- SetMenuItemTextWithCFString(macMenuHdl, base + index, cf);
- CFRelease(cf);
+ if (cf != NULL) {
+ SetMenuItemTextWithCFString(macMenuHdl, base + index, cf);
+ CFRelease(cf);
+ } else {
+ cf = CFSTR ("<Error>");
+ SetMenuItemTextWithCFString(macMenuHdl, base + index, cf);
+ }
+
Tcl_DStringFree(&itemTextDString);
/*
@@ -4678,4 +4684,4 @@ HandleMenuCalcItemMsg(MenuRef menu,
}
menuRectPtr->bottom = menuRectPtr->top
+ mePtr->height;
-} \ No newline at end of file
+}