From 6848719f540885805724fd350ef6574e6fc97992 Mon Sep 17 00:00:00 2001 From: culler Date: Wed, 16 Oct 2024 02:34:00 +0000 Subject: [PATCH] Make updateLayer a no-op during exit. --- macosx/tkMacOSXInit.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index b5fbd6ef1..e7a645552 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -406,9 +406,16 @@ TCL_NORETURN void TkpExitProc( * At this point it is too late to be looking up the Tk window associated * to any NSWindows, but it can happen. This makes sure the answer is None * if such a query is attempted. + * It is also too late to be updating the backing layer of a window. All + * tkLayerBitmapContext properties are set to nil so that updateLayer will + * return immediately. */ for (TKWindow *w in [NSApp orderedWindows]) { + NSView *view = [w contentView]; + if ([view respondsToSelector: @selector (tkLayerBitmapContext)]) { + [view setTkLayerBitmapContext: nil]; + } if ([w respondsToSelector: @selector (tkWindow)]) { [w setTkWindow: None]; }