summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixCursor.c
diff options
context:
space:
mode:
Diffstat (limited to 'unix/tkUnixCursor.c')
-rw-r--r--unix/tkUnixCursor.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/unix/tkUnixCursor.c b/unix/tkUnixCursor.c
index 876ea2d..8755a3c 100644
--- a/unix/tkUnixCursor.c
+++ b/unix/tkUnixCursor.c
@@ -3,12 +3,12 @@
*
* This file contains X specific cursor manipulation routines.
*
- * Copyright (c) 1995 Sun Microsystems, Inc.
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkUnixCursor.c,v 1.3 1998/09/14 18:23:55 stanton Exp $
+ * RCS: @(#) $Id: tkUnixCursor.c,v 1.4 1999/04/16 01:51:45 stanton Exp $
*/
#include "tkPort.h"
@@ -218,7 +218,7 @@ TkGetCursorByName(interp, tkwin, string)
if (dispPtr->cursorFont == None) {
dispPtr->cursorFont = XLoadFont(display, CURSORFONT);
if (dispPtr->cursorFont == None) {
- interp->result = "couldn't load cursor font";
+ Tcl_SetResult(interp, "couldn't load cursor font", TCL_STATIC);
goto cleanup;
}
}
@@ -282,8 +282,9 @@ TkGetCursorByName(interp, tkwin, string)
goto cleanup;
}
if ((maskWidth != width) && (maskHeight != height)) {
- interp->result =
- "source and mask bitmaps have different sizes";
+ Tcl_SetResult(interp,
+ "source and mask bitmaps have different sizes",
+ TCL_STATIC);
goto cleanup;
}
if (XParseColor(display, Tk_Colormap(tkwin), argv[2],
@@ -323,6 +324,9 @@ TkGetCursorByName(interp, tkwin, string)
badString:
+ if (argv) {
+ ckfree((char *) argv);
+ }
Tcl_AppendResult(interp, "bad cursor spec \"", string, "\"",
(char *) NULL);
return NULL;
@@ -382,7 +386,7 @@ TkCreateCursorFromData(tkwin, source, mask, width, height, xHot, yHot,
/*
*----------------------------------------------------------------------
*
- * TkFreeCursor --
+ * TkpFreeCursor --
*
* This procedure is called to release a cursor allocated by
* TkGetCursorByName.
@@ -397,11 +401,10 @@ TkCreateCursorFromData(tkwin, source, mask, width, height, xHot, yHot,
*/
void
-TkFreeCursor(cursorPtr)
+TkpFreeCursor(cursorPtr)
TkCursor *cursorPtr;
{
TkUnixCursor *unixCursorPtr = (TkUnixCursor *) cursorPtr;
XFreeCursor(unixCursorPtr->display, (Cursor) unixCursorPtr->info.cursor);
Tk_FreeXId(unixCursorPtr->display, (XID) unixCursorPtr->info.cursor);
- ckfree((char *) unixCursorPtr);
}