]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/toplevel.cpp
Fixed a lost #else
[wxWidgets.git] / src / mac / toplevel.cpp
index a9acd84e2cd0acc0de9874549c89bf909319e4bc..b197af73a748f105c2ac0ee4d4332bf1e5920635 100644 (file)
@@ -112,6 +112,21 @@ void wxTopLevelWindowMac::Init()
     m_macWindow = NULL ;
 }
 
+class wxMacDeferredWindowDeleter : public wxObject
+{
+public :
+    wxMacDeferredWindowDeleter( WindowRef windowRef ) 
+    { 
+        m_macWindow = windowRef ; 
+    }
+    virtual ~wxMacDeferredWindowDeleter() 
+    { 
+        UMADisposeWindow( (WindowRef) m_macWindow ) ; 
+    }
+ protected :
+    WindowRef m_macWindow ;
+} ;
+
 bool wxTopLevelWindowMac::Create(wxWindow *parent,
                                  wxWindowID id,
                                  const wxString& title,
@@ -142,7 +157,7 @@ wxTopLevelWindowMac::~wxTopLevelWindowMac()
     if ( m_macWindow )
     {
         wxToolTip::NotifyWindowDelete(m_macWindow) ;
-        UMADisposeWindow( (WindowRef) m_macWindow ) ;
+        wxPendingDelete.Append( new wxMacDeferredWindowDeleter( (WindowRef) m_macWindow ) ) ;
     }
     
     wxRemoveMacWindowAssociation( this ) ;