summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXButton.c
diff options
context:
space:
mode:
authorseandeelywoods <seandeelywoods@noemail.net>2014-08-27 13:07:52 (GMT)
committerseandeelywoods <seandeelywoods@noemail.net>2014-08-27 13:07:52 (GMT)
commit8d245e5cd722fa1b299de1e2345ca167d414457f (patch)
tree19a93b6b3c564cff846a7c09ed812b4253ef451a /macosx/tkMacOSXButton.c
parent28b82d0bb11314a48d013d69e65085b5fbcbe804 (diff)
downloadtk-8d245e5cd722fa1b299de1e2345ca167d414457f.zip
tk-8d245e5cd722fa1b299de1e2345ca167d414457f.tar.gz
tk-8d245e5cd722fa1b299de1e2345ca167d414457f.tar.bz2
Fix for segfaults induced by the following script:
button .b pack .b update destroy .b button .c update FossilOrigin-Name: 02f369ec275f3ef007cd075b389d239100736765
Diffstat (limited to 'macosx/tkMacOSXButton.c')
-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));