X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c9667cda38388d1f82f805d6d8cdcdca4a1ae877..f68c6b523c1117c90c1cf690745c807bc024789d:/src/os2/menu.cpp diff --git a/src/os2/menu.cpp b/src/os2/menu.cpp index c63cfe2fea..8007899907 100644 --- a/src/os2/menu.cpp +++ b/src/os2/menu.cpp @@ -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 // ---------------------------------------------------------------------------