]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/toplvcmn.cpp
fixing overrelease and out-of-bounds write, fixes #13725
[wxWidgets.git] / src / common / toplvcmn.cpp
index 1ce788ef1f3b40907a7240f5e6f33b42f17ec2ba..e93cdc024f329c6186c16be7993f1f81c1065d0b 100644 (file)
@@ -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() )
     {