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)
commita005af2cae512fc901d06236dc97190523de6bb5 (patch)
tree19a93b6b3c564cff846a7c09ed812b4253ef451a
parentd7317334ddd8285bf5474b22aa66e5f025e401df (diff)
downloadtk-a005af2cae512fc901d06236dc97190523de6bb5.zip
tk-a005af2cae512fc901d06236dc97190523de6bb5.tar.gz
tk-a005af2cae512fc901d06236dc97190523de6bb5.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));