wxMenuBar::~wxMenuBar()
{
+ // we should free Windows resources only if Windows doesn't do it for us
+ // which happens if we're attached to a frame
+ if (m_hMenu && !IsAttached())
+ {
+ ::DestroyMenu((HMENU)m_hMenu);
+ m_hMenu = (WXHMENU)NULL;
+ }
}
// ---------------------------------------------------------------------------
void wxMenuBar::Detach()
{
- m_hMenu = (WXHMENU)NULL;
-
wxMenuBarBase::Detach();
}