]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/menu.cpp
mingw compilation fix
[wxWidgets.git] / src / os2 / menu.cpp
index c63cfe2feaa4f019ed8626063387de657d42548c..8007899907d0d1808edba1c4881d6daf448bf906 100644 (file)
@@ -73,9 +73,11 @@ static wxString TextToLabel(
   const wxString&                   rsTitle
 )
 {
-    wxString                        sTitle;
+    wxString                        sTitle = "";
     const wxChar*                   zPc;
 
+    if (rsTitle.IsEmpty())
+        return sTitle;
     for (zPc = rsTitle.c_str(); *zPc != wxT('\0'); zPc++ )
     {
         if (*zPc == wxT('&') )
@@ -291,6 +293,7 @@ bool wxMenu::DoInsertOrAppend(
     ERRORID                         vError;
     wxString                        sError;
     char                            zMsg[128];
+
 #if wxUSE_ACCEL
     UpdateAccel(pItem);
 #endif // wxUSE_ACCEL
@@ -747,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
 
 // ---------------------------------------------------------------------------