From 86c1fe4c7956e935695fb00130ab6e35788443be Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Tue, 5 Jan 2021 15:35:48 +0100 Subject: [PATCH] Fixing crash under BigSur We get a late redraw event in the current 11.X versions, fixes #19030 --- src/osx/cocoa/window.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index bd249c3e3c..bca8dc1a13 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -2310,6 +2310,9 @@ void wxWidgetCocoaImpl::drawRect(void* rect, WXWidget slf, void *WXUNUSED(_cmd)) // Restrict the update region to the shape of the window, if any, and also // remember the region that we need to clear later. wxNonOwnedWindow* const tlwParent = wxpeer->MacGetTopLevelWindow(); + if ( tlwParent == NULL ) + return; + const bool isTopLevel = tlwParent == wxpeer; wxRegion clearRgn; if ( tlwParent->GetWindowStyle() & wxFRAME_SHAPED )