X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d2824cdb7f6ac2371fefd3d44eff62bb48ebc0a3..8d43e8c68fd5d508a1628909c696fff938c9eb1e:/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