summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhypnotoad <yoda@etoyoc.com>2014-08-27 13:07:52 (GMT)
committerhypnotoad <yoda@etoyoc.com>2014-08-27 13:07:52 (GMT)
commitd07eb9d0d067d0fb074f4a44211ea8fb696d6eec (patch)
tree19a93b6b3c564cff846a7c09ed812b4253ef451a
parentd68c4a777152da4c4bd440e6e35961eaebf57127 (diff)
downloadtk-d07eb9d0d067d0fb074f4a44211ea8fb696d6eec.zip
tk-d07eb9d0d067d0fb074f4a44211ea8fb696d6eec.tar.gz
tk-d07eb9d0d067d0fb074f4a44211ea8fb696d6eec.tar.bz2
Fix for segfaults induced by the following script:
button .b pack .b update destroy .b button .c update
-rw-r--r--macosx/tkMacOSXButton.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c
index dd4cca7..9250884 100644
--- a/macosx/tkMacOSXButton.c
+++ b/macosx/tkMacOSXButton.c
@@ -379,6 +379,9 @@ NSRect TkMacOSXGetButtonFrame(
if (tkwin) {
MacDrawable *macWin = (MacDrawable *) winPtr->window;
NSView *view = TkMacOSXDrawableView(macWin);
+ if(view==nil) {
+ return NSZeroRect;
+ }
CGFloat viewHeight = [view bounds].size.height;
NSRect frame = NSMakeRect(macWin->xOff, macWin->yOff,
Tk_Width(tkwin), Tk_Height(tkwin));