X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d2824cdb7f6ac2371fefd3d44eff62bb48ebc0a3..e9e8b38179b147dd04f5c19af7e56a94342e93a7:/include/wx/mdi.h diff --git a/include/wx/mdi.h b/include/wx/mdi.h index e11290ead9..37f0fa5208 100644 --- a/include/wx/mdi.h +++ b/include/wx/mdi.h @@ -17,6 +17,7 @@ #if wxUSE_MDI #include "wx/frame.h" +#include "wx/menu.h" // forward declarations class WXDLLIMPEXP_FWD_CORE wxMDIParentFrame; @@ -87,8 +88,11 @@ public: // menu can be NULL to disable the window menu completely virtual void SetWindowMenu(wxMenu *menu) { - delete m_windowMenu; - m_windowMenu = menu; + if ( menu != m_windowMenu ) + { + delete m_windowMenu; + m_windowMenu = menu; + } } #endif // wxUSE_MENUS