X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d2824cdb7f6ac2371fefd3d44eff62bb48ebc0a3..c5c1ea964817e562d1c4b0d89b3937fce28c3f10:/include/wx/mdi.h?ds=inline 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