From d1bb1bb5bf6daca7842a619d420f64268f806ee9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sun, 10 Dec 2006 15:58:18 +0000 Subject: [PATCH] 1. removed code that already exist in ~wxTLWBase from ~wxTLW 2. reordered TLW destruction so that the TLW is fully usable until all children (that could possibly use it from their dtors) are destroyed git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43902 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/dfb/toplevel.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/dfb/toplevel.cpp b/src/dfb/toplevel.cpp index 5c042f3358..b5dcc161da 100644 --- a/src/dfb/toplevel.cpp +++ b/src/dfb/toplevel.cpp @@ -176,16 +176,11 @@ wxTopLevelWindowDFB::~wxTopLevelWindowDFB() { m_isBeingDeleted = true; - wxTopLevelWindows.DeleteObject(this); - - if ( wxTheApp->GetTopWindow() == this ) - wxTheApp->SetTopWindow(NULL); - - if ( wxTopLevelWindows.empty() && wxTheApp->GetExitOnFrameDelete() ) - { - wxTheApp->ExitMainLoop(); - } + // destroy all children before we destroy the underlying DirectFB window, + // so that if any of them does something with the TLW, it will still work: + DestroyChildren(); + // it's safe to delete the underlying DirectFB window now: wxDELETE(m_toPaint); if ( !m_dfbwin ) -- 2.45.2