From 87c8b231c8ceda0f5f252005298c67175413eb75 Mon Sep 17 00:00:00 2001 From: wolfsuit Date: Mon, 26 Aug 2002 21:57:44 +0000 Subject: 08/26/2002 Jim Ingham < jingham@apple.com> tkMacOSXMenu.c: In ReconfigureIndividualMenu, guard against the CFStringFromCString returning NULL. In this case, insert "" for the menu item text, for want of a better thing to do... --- macosx/tkMacOSXMenu.c | 14 ++++++++++---- 1 file 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 (""); + 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 +} -- cgit v0.12