X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8635b0dbb3342cb7de5d4c0f5775f83cfabfd74a..44c2d8d0f39b589e35812be00c9f3721a7f48913:/src/os2/menu.cpp diff --git a/src/os2/menu.cpp b/src/os2/menu.cpp index 8ca65be64b..8007899907 100644 --- a/src/os2/menu.cpp +++ b/src/os2/menu.cpp @@ -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 // ---------------------------------------------------------------------------