From: Václav Slavík Date: Sun, 26 Nov 2006 20:05:14 +0000 (+0000) Subject: destroy IDirectFBWindow in wxTLW dtor X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/82c74d895002129b9ff2042414afc742c1a451d8 destroy IDirectFBWindow in wxTLW dtor git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43660 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/dfb/toplevel.cpp b/src/dfb/toplevel.cpp index c7f23b52df..5c042f3358 100644 --- a/src/dfb/toplevel.cpp +++ b/src/dfb/toplevel.cpp @@ -138,7 +138,7 @@ bool wxTopLevelWindowDFB::Create(wxWindow *parent, desc.width = size.x; desc.height = size.y; m_dfbwin = layer->CreateWindow(&desc); - if ( !layer ) + if ( !m_dfbwin ) return false; // add the new TLW to DFBWindowID->wxTLW map: @@ -188,10 +188,16 @@ wxTopLevelWindowDFB::~wxTopLevelWindowDFB() wxDELETE(m_toPaint); + if ( !m_dfbwin ) + return; + // remove the TLW from DFBWindowID->wxTLW map: DFBWindowID winid; if ( m_dfbwin->GetID(&winid) ) gs_dfbWindowsMap.erase(winid); + + m_dfbwin->Destroy(); + m_dfbwin.Reset(); } // ----------------------------------------------------------------------------