diff options
author | culler <culler> | 2021-04-27 19:35:45 (GMT) |
---|---|---|
committer | culler <culler> | 2021-04-27 19:35:45 (GMT) |
commit | 5548b9384faa00a2bb51f6b6f1cb9533eeaf246c (patch) | |
tree | 7790e3ac58ccc33220258152a4f30667daf5259b /macosx/tkMacOSXWm.c | |
parent | 81a7dbc90f3961dc72cc728dc321d7e488e4d4c1 (diff) | |
download | tk-5548b9384faa00a2bb51f6b6f1cb9533eeaf246c.zip tk-5548b9384faa00a2bb51f6b6f1cb9533eeaf246c.tar.gz tk-5548b9384faa00a2bb51f6b6f1cb9533eeaf246c.tar.bz2 |
Try to avoid the rare crash in Tk_MacOSXGetTkWindow which has been seen at exit a few times.
Diffstat (limited to 'macosx/tkMacOSXWm.c')
-rw-r--r-- | macosx/tkMacOSXWm.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 4f073d8..77f7b09 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -5535,12 +5535,15 @@ Tk_MacOSXGetTkWindow( void *w) { Window window = None; - TkDisplay *dispPtr = TkGetDisplayList(); if ([(NSWindow *)w respondsToSelector: @selector (tkWindow)]) { window = [(TKWindow *)w tkWindow]; } - return (window != None ? - Tk_IdToWindow(dispPtr->display, window) : NULL); + if (window) { + TkDisplay *dispPtr = TkGetDisplayList(); + return Tk_IdToWindow(dispPtr->display, window); + } else { + return NULL; + } } /* |