From 5f9f6b4742021cbfc2ff3dfd9d32e49565c6652e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 30 Aug 2012 20:20:20 +0000 Subject: [PATCH] Don't lay out the window being destroyed unnecessarily. This is just a small optimization: it's useless to waste time on redoing the layout of a window that is going to be destroyed soon anyhow. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72403 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/toplvcmn.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/common/toplvcmn.cpp b/src/common/toplvcmn.cpp index 1ce788ef1f..e93cdc024f 100644 --- a/src/common/toplvcmn.cpp +++ b/src/common/toplvcmn.cpp @@ -361,6 +361,14 @@ void wxTopLevelWindowBase::SetIcon(const wxIcon& icon) // whole client area void wxTopLevelWindowBase::DoLayout() { + // We are called during the window destruction several times, e.g. as + // wxFrame tries to adjust to its tool/status bars disappearing. But + // actually doing the layout is pretty useless in this case as the window + // will disappear anyhow -- so just don't bother. + if ( IsBeingDeleted() ) + return; + + // if we're using constraints or sizers - do use them if ( GetAutoLayout() ) { -- 2.45.2