diff --git a/src/xrc/xh_menu.cpp b/src/xrc/xh_menu.cpp index f6cc1963f1..275c78aa62 100644 --- a/src/xrc/xh_menu.cpp +++ b/src/xrc/xh_menu.cpp @@ -148,7 +148,17 @@ wxMenuBarXmlHandler::wxMenuBarXmlHandler() : wxXmlResourceHandler() wxObject *wxMenuBarXmlHandler::DoCreateResource() { - wxMenuBar *menubar = new wxMenuBar(GetStyle()); + wxMenuBar *menubar = NULL; + + const int style = GetStyle(); + wxASSERT_MSG(!style || !m_instance, + "cannot use