diff options
-rw-r--r-- | generic/tkText.c | 4 | ||||
-rw-r--r-- | macosx/tkMacOSXDialog.c | 26 |
2 files changed, 27 insertions, 3 deletions
diff --git a/generic/tkText.c b/generic/tkText.c index c04dae0..b051e9d 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkText.c,v 1.86 2008/12/06 10:48:29 dkf Exp $ + * RCS: @(#) $Id: tkText.c,v 1.87 2008/12/07 16:32:44 das Exp $ */ #include "default.h" @@ -2664,7 +2664,7 @@ TextPushUndoAction( Tcl_Obj *seeInsertObj = Tcl_NewObj(); Tcl_Obj *markSet1InsertObj = Tcl_NewObj(); - Tcl_Obj *markSet2InsertObj = Tcl_NewObj(); + Tcl_Obj *markSet2InsertObj = NULL; Tcl_Obj *insertCmdObj = Tcl_NewObj(); Tcl_Obj *deleteCmdObj = Tcl_NewObj(); diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 7cba460..9b1c22d 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXDialog.c,v 1.39 2008/10/17 23:18:38 nijtmans Exp $ + * RCS: @(#) $Id: tkMacOSXDialog.c,v 1.40 2008/12/07 16:32:44 das Exp $ */ #include "tkMacOSXPrivate.h" @@ -323,6 +323,9 @@ Tk_GetOpenFileObjCmd( break; case OPEN_MESSAGE: choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); + if (message) { + CFRelease(message); + } message = CFStringCreateWithBytes(NULL, (unsigned char *) choice, choiceLen, kCFStringEncodingUTF8, false); break; @@ -341,6 +344,9 @@ Tk_GetOpenFileObjCmd( break; case OPEN_TITLE: choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); + if (title) { + CFRelease(title); + } title = CFStringCreateWithBytes(NULL, (unsigned char *) choice, choiceLen, kCFStringEncodingUTF8, false); break; @@ -478,6 +484,9 @@ Tk_GetSaveFileObjCmd( break; case SAVE_MESSAGE: choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); + if (message) { + CFRelease(message); + } message = CFStringCreateWithBytes(NULL, (unsigned char *) choice, choiceLen, kCFStringEncodingUTF8, false); break; @@ -490,6 +499,9 @@ Tk_GetSaveFileObjCmd( break; case SAVE_TITLE: choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); + if (title) { + CFRelease(title); + } title = CFStringCreateWithBytes(NULL, (unsigned char *) choice, choiceLen, kCFStringEncodingUTF8, false); break; @@ -582,6 +594,9 @@ Tk_ChooseDirectoryObjCmd( break; case CHOOSE_MESSAGE: choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); + if (message) { + CFRelease(message); + } message = CFStringCreateWithBytes(NULL, (unsigned char *) choice, choiceLen, kCFStringEncodingUTF8, false); break; @@ -594,6 +609,9 @@ Tk_ChooseDirectoryObjCmd( break; case CHOOSE_TITLE: choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); + if (title) { + CFRelease(title); + } title = CFStringCreateWithBytes(NULL, (unsigned char *) choice, choiceLen, kCFStringEncodingUTF8, false); break; @@ -1483,6 +1501,9 @@ Tk_MessageBoxObjCmd( case ALERT_DETAIL: str = Tcl_GetString(objv[i + 1]); + if (finemessageTextCF) { + CFRelease(finemessageTextCF); + } finemessageTextCF = CFStringCreateWithCString(NULL, str, kCFStringEncodingUTF8); break; @@ -1510,6 +1531,9 @@ Tk_MessageBoxObjCmd( case ALERT_MESSAGE: str = Tcl_GetString(objv[i + 1]); + if (messageTextCF) { + CFRelease(messageTextCF); + } messageTextCF = CFStringCreateWithCString(NULL, str, kCFStringEncodingUTF8); break; |