summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorculler <culler>2017-11-24 23:08:38 (GMT)
committerculler <culler>2017-11-24 23:08:38 (GMT)
commit2c19669804700430a0e382aa33af1d0c6ed7c7f6 (patch)
treec8b15bdf2d15b84484985d96bd8e6069c3684074
parent80c89f42158a7900b0bdbd5066936b3075501a34 (diff)
downloadtk-2c19669804700430a0e382aa33af1d0c6ed7c7f6.zip
tk-2c19669804700430a0e382aa33af1d0c6ed7c7f6.tar.gz
tk-2c19669804700430a0e382aa33af1d0c6ed7c7f6.tar.bz2
Don't process window events if the dead window is the root. This
is unnecessary and leads to segfaults in some tests.
-rw-r--r--macosx/tkMacOSXEmbed.c4
-rw-r--r--macosx/tkMacOSXWm.c4
2 files changed, 7 insertions, 1 deletions
diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c
index 99f7584..0c2ca69 100644
--- a/macosx/tkMacOSXEmbed.c
+++ b/macosx/tkMacOSXEmbed.c
@@ -799,6 +799,10 @@ ContainerEventProc(
Container *containerPtr;
Tk_ErrorHandler errHandler;
+ if (!firstContainerPtr) {
+ TKLog(@"Embedded window has nil container.");
+ return;
+ }
/*
* Ignore any X protocol errors that happen in this procedure (almost any
* operation could fail, for example, if the embedded application has
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index 4cd6efb..832cf2f 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -933,7 +933,9 @@ TkWmDeadWindow(
* Process all events immediately to force the closed window
* to be deallocated.
*/
- while (Tk_DoOneEvent(TK_ALL_EVENTS|TK_DONT_WAIT)) {}
+ if (winPtr->parentPtr) {
+ while (Tk_DoOneEvent(TK_WINDOW_EVENTS|TK_DONT_WAIT)) {}
+ }
[NSApp _resetAutoreleasePool];
#if DEBUG_ZOMBIES > 0