Skip to content

Commit

Permalink
Fix crash at exit on macOS 12.
Browse files Browse the repository at this point in the history
  • Loading branch information
culler committed Oct 16, 2024
2 parents dedbbe2 + 6848719 commit 190ba98
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions macosx/tkMacOSXInit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]) {
TKContentView *view = (TKContentView *) [w contentView];
if ([view respondsToSelector: @selector (tkLayerBitmapContext)]) {
[view setTkLayerBitmapContext: nil];
}
if ([w respondsToSelector: @selector (tkWindow)]) {
[w setTkWindow: None];
}
Expand Down

0 comments on commit 190ba98

Please sign in to comment.