Subject: Fix for segfaults induced by the following script:

From: hypnotoad <[email-masked]>
Date: Wed, 27 Aug 2014 13:07:52 +0000

button .b
pack .b
update
destroy .b
button .c
update
---
 macosx/tkMacOSXButton.c | 3 +++
 1 file changed, 3 insertions(+)

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));
-- 
cgit v0.12