Tk Source Code

Artifact [cccebcad]
Login

Artifact cccebcadfb07f5519de0867f5658a379a16ba908bb4873dccc7860476e645862:

Attachment "fa4694dc.diff" to ticket [fa4694dc] added by chrstphrchvz 2023-07-10 13:18:56.
diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c
--- macosx/tkMacOSXMenu.c
+++ macosx/tkMacOSXMenu.c
@@ -755,11 +755,12 @@
     }
     [menuItem setImage:image];
     if ((!image || mePtr->compound != COMPOUND_NONE) && mePtr->labelPtr &&
 	    mePtr->labelLength) {
-	title = [[TKNSString alloc]
+	title = [[[TKNSString alloc]
 		    initWithTclUtfBytes:Tcl_GetString(mePtr->labelPtr)
-				length:mePtr->labelLength];
+				 length:mePtr->labelLength]
+		autorelease];
 	if ([title hasSuffix:@"..."]) {
 	    title = [NSString stringWithFormat:@"%@%C",
 		    [title substringToIndex:[title length] - 3], 0x2026];
 	}