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;
+ }
}
// ---------------------------------------------------------------------------
{
wxMenu *menuOld = wxMenuBarBase::Replace(pos, menu, title);
if ( !menuOld )
- return FALSE;
+ return NULL;
+
m_titles[pos] = title;
if ( IsAttached() )
void wxMenuBar::Detach()
{
- m_hMenu = (WXHMENU)NULL;
-
wxMenuBarBase::Detach();
}