summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXWm.c
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2017-04-20 01:47:21 (GMT)
committerKevin Walzer <kw@codebykevin.com>2017-04-20 01:47:21 (GMT)
commit63b6554668963fa5a4b94cd64931e556ad154fcb (patch)
tree5d519469dc3390324b22ee9e4e7d6950d46e4955 /macosx/tkMacOSXWm.c
parent985621e3f1a0ac065a03f17f846d6004dfc2e827 (diff)
downloadtk-63b6554668963fa5a4b94cd64931e556ad154fcb.zip
tk-63b6554668963fa5a4b94cd64931e556ad154fcb.tar.gz
tk-63b6554668963fa5a4b94cd64931e556ad154fcb.tar.bz2
1. Fix for segfault with latest version of Xcode on macOS 10.12; thanks to Bill Joye for patch. 2. Improvements to HITheme scroller on macOS: smoother scrolling, and scrollbar now correctly highlights when being pressed and during enter/leave events. Thanks to Tortsen Reincke for bug report (061bf93176a5684a4a855f8177b290c59dd39bf2).
Diffstat (limited to 'macosx/tkMacOSXWm.c')
-rw-r--r--macosx/tkMacOSXWm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index 39990e6..75473bf 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -2893,17 +2893,20 @@ WmProtocolCmd(
} else {
prevPtr->nextPtr = protPtr->nextPtr;
}
+ if (protPtr->command)
+ ckfree(protPtr->command);
Tcl_EventuallyFree(protPtr, TCL_DYNAMIC);
break;
}
}
cmd = Tcl_GetStringFromObj(objv[4], &cmdLength);
if (cmdLength > 0) {
- protPtr = ckalloc(HANDLER_SIZE(cmdLength));
+ protPtr = ckalloc(sizeof(ProtocolHandler));
protPtr->protocol = protocol;
protPtr->nextPtr = wmPtr->protPtr;
wmPtr->protPtr = protPtr;
protPtr->interp = interp;
+ protPtr->command = ckalloc(cmdLength+1);
strcpy(protPtr->command, cmd);
}
return TCL_OK;