check that item pointer is non-NULL in WM_DRAW/MEASUREITEM
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29818 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -3662,7 +3662,8 @@ wxWindowMSW::MSWOnDrawItem(int WXUNUSED_UNLESS_ODRAWN(id),
|
|||||||
{
|
{
|
||||||
wxMenuItem *pMenuItem = (wxMenuItem *)(pDrawStruct->itemData);
|
wxMenuItem *pMenuItem = (wxMenuItem *)(pDrawStruct->itemData);
|
||||||
|
|
||||||
wxCHECK( pMenuItem->IsKindOf(CLASSINFO(wxMenuItem)), false );
|
wxCHECK_MSG( pMenuItem && pMenuItem->IsKindOf(CLASSINFO(wxMenuItem)),
|
||||||
|
false, _T("MSWOnDrawItem: bad wxMenuItem pointer") );
|
||||||
|
|
||||||
// prepare to call OnDrawItem(): notice using of wxDCTemp to prevent
|
// prepare to call OnDrawItem(): notice using of wxDCTemp to prevent
|
||||||
// the DC from being released
|
// the DC from being released
|
||||||
@@ -3719,7 +3720,8 @@ wxWindowMSW::MSWOnMeasureItem(int id, WXMEASUREITEMSTRUCT *itemStruct)
|
|||||||
{
|
{
|
||||||
wxMenuItem *pMenuItem = (wxMenuItem *)(pMeasureStruct->itemData);
|
wxMenuItem *pMenuItem = (wxMenuItem *)(pMeasureStruct->itemData);
|
||||||
|
|
||||||
wxCHECK( pMenuItem->IsKindOf(CLASSINFO(wxMenuItem)), false );
|
wxCHECK_MSG( pMenuItem && pMenuItem->IsKindOf(CLASSINFO(wxMenuItem)),
|
||||||
|
false, _T("MSWOnMeasureItem: bad wxMenuItem pointer") );
|
||||||
|
|
||||||
size_t w, h;
|
size_t w, h;
|
||||||
bool rc = pMenuItem->OnMeasureItem(&w, &h);
|
bool rc = pMenuItem->OnMeasureItem(&w, &h);
|
||||||
|
Reference in New Issue
Block a user