destroy IDirectFBWindow in wxTLW dtor
authorVáclav Slavík <vslavik@fastmail.fm>
Sun, 26 Nov 2006 20:05:14 +0000 (20:05 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sun, 26 Nov 2006 20:05:14 +0000 (20:05 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43660 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/dfb/toplevel.cpp

index c7f23b52df4246338aba7e12f37a079631f71de9..5c042f3358a574ca434c80eb8c68f077927f7aed 100644 (file)
@@ -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();
 }
 
 // ----------------------------------------------------------------------------