From: Vadim Zeitlin Date: Sun, 10 Apr 2005 22:13:33 +0000 (+0000) Subject: silently ignore NULL pointers in MSWOnMeasureItem(): apparently this can happen with... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b6afa1a38a78ac44ec984fbd211f658f2f80094b silently ignore NULL pointers in MSWOnMeasureItem(): apparently this can happen with MDI frames under XP git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33491 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/window.cpp b/src/msw/window.cpp index d4d1edf578..c6380d49de 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -3656,7 +3656,15 @@ wxWindowMSW::MSWOnMeasureItem(int id, WXMEASUREITEMSTRUCT *itemStruct) { wxMenuItem *pMenuItem = (wxMenuItem *)(pMeasureStruct->itemData); - wxCHECK_MSG( pMenuItem && pMenuItem->IsKindOf(CLASSINFO(wxMenuItem)), + // according to Carsten Fuchs the pointer may be NULL under XP if an + // MDI child frame is initially maximized, see this for more info: + // http://article.gmane.org/gmane.comp.lib.wxwidgets.general/27745 + // + // so silently ignore it instead of asserting + if ( !pMenuItem ) + return false; + + wxCHECK_MSG( wxDynamicCast(pMenuItem, wxMenuItem), false, _T("MSWOnMeasureItem: bad wxMenuItem pointer") ); size_t w, h;