From 55453902cf3de34e45799dbc6fc7f59f6151ef56 Mon Sep 17 00:00:00 2001 From: culler Date: Thu, 13 Jun 2024 03:41:50 +0000 Subject: Try to guard against crashes in TkpChangeFocus --- macosx/tkMacOSXWindowEvent.c | 1 - macosx/tkMacOSXWm.c | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 3681d60..d99c06b 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -1175,7 +1175,6 @@ ConfigureRestrictProc( while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {} } } - reentered = 0; } diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index c1c7f92..857524c 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -7225,7 +7225,10 @@ TkpChangeFocus( * didn't originally belong to topLevelPtr's * application. */ { - if (winPtr->atts.override_redirect) { + if (!winPtr || + (winPtr->flags & TK_ALREADY_DEAD) || + !Tk_IsMapped(winPtr) || + winPtr->atts.override_redirect) { return 0; } -- cgit v0.12