From 6ee518417137651e4a46959eb1a86fda6dc93155 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 26 Jun 2019 18:37:31 +0200 Subject: [PATCH] Check window validity in wxNonOwnedWindow::Update() in wxMac too This was already done in the other functions, but not this one, resulting in a crash if it was called for an object with null m_nowpeer (e.g. before it's created or when it's not a real wxNonOwnedWindow object as when it's a subobject of wxTDIChildFrame). See #18423. --- src/osx/nonownedwnd_osx.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/osx/nonownedwnd_osx.cpp b/src/osx/nonownedwnd_osx.cpp index cbc20eda73..d17624f029 100644 --- a/src/osx/nonownedwnd_osx.cpp +++ b/src/osx/nonownedwnd_osx.cpp @@ -481,6 +481,9 @@ void wxNonOwnedWindow::WindowWasPainted() void wxNonOwnedWindow::Update() { + if ( m_nowpeer == NULL ) + return; + if ( clock() - s_lastFlush > CLOCKS_PER_SEC / 30 ) { s_lastFlush = clock();