]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/toplvcmn.cpp
Fix (correct) warning about potentially uninitialized variables.
[wxWidgets.git] / src / common / toplvcmn.cpp
index 8768de7360de4fe2f0f4de89663baaaf7637f137..71bc0468d3ba3af893e7a2248ee8560176c0c147 100644 (file)
@@ -16,7 +16,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "toplevelbase.h"
 #endif
 
@@ -80,6 +80,9 @@ bool wxTopLevelWindowBase::Destroy()
     if ( !wxPendingDelete.Member(this) )
         wxPendingDelete.Append(this);
 
+    // but hide it immediately
+    Hide();
+
     return TRUE;
 }
 
@@ -161,7 +164,7 @@ void wxTopLevelWindowBase::OnSize(wxSizeEvent& WXUNUSED(event))
     {
         // do we have _exactly_ one child?
         wxWindow *child = (wxWindow *)NULL;
-        for ( wxWindowList::Node *node = GetChildren().GetFirst();
+        for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
               node;
               node = node->GetNext() )
         {