]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/menu.cpp
mingw compilation fix
[wxWidgets.git] / src / os2 / menu.cpp
index 8ca65be64b336bc72378cd49160b300d4c0d9b78..8007899907d0d1808edba1c4881d6daf448bf906 100644 (file)
@@ -750,6 +750,15 @@ wxMenuBar::wxMenuBar(
 
 wxMenuBar::~wxMenuBar()
 {
+    //
+    // We should free PM's resources only if PM doesn't do it for us
+    // which happens if we're attached to a frame
+    //
+    if (m_hMenu && !IsAttached())
+    {
+        ::WinDestroyWindow((HMENU)m_hMenu);
+        m_hMenu = (WXHMENU)NULL;
+    }
 } // end of wxMenuBar::~wxMenuBar
 
 // ---------------------------------------------------------------------------