From 376b7bd99efb49e6bfb895f721c8679a9bcceb52 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 23 Apr 2003 21:11:32 +0000 Subject: [PATCH] wxCHECK for valid menu in DoPopupMenu (SF Bug# 722230) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@20320 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/window.cpp | 2 ++ src/mac/window.cpp | 2 ++ src/msw/window.cpp | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index 480a56083d..640050428b 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -377,6 +377,8 @@ static void MacMenuBeforeDisplay( wxMenu* menu ); bool wxWindowMac::DoPopupMenu(wxMenu *menu, int x, int y) { + wxCHECK_MSG( menu != NULL, FALSE, wxT("invalid popup-menu") ); + menu->SetInvokingWindow(this); menu->UpdateUI(); ClientToScreen( &x , &y ) ; diff --git a/src/mac/window.cpp b/src/mac/window.cpp index 480a56083d..640050428b 100644 --- a/src/mac/window.cpp +++ b/src/mac/window.cpp @@ -377,6 +377,8 @@ static void MacMenuBeforeDisplay( wxMenu* menu ); bool wxWindowMac::DoPopupMenu(wxMenu *menu, int x, int y) { + wxCHECK_MSG( menu != NULL, FALSE, wxT("invalid popup-menu") ); + menu->SetInvokingWindow(this); menu->UpdateUI(); ClientToScreen( &x , &y ) ; diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 3eacbce049..4822d5b199 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1899,6 +1899,8 @@ static void wxYieldForCommandsOnly() bool wxWindowMSW::DoPopupMenu(wxMenu *menu, int x, int y) { + wxCHECK_MSG( menu != NULL, FALSE, wxT("invalid popup-menu") ); + menu->SetInvokingWindow(this); menu->UpdateUI();