From 268766dd1f2a2d4d593d1d65893f62b5753ff20b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 10 Oct 2001 00:11:23 +0000 Subject: [PATCH] fixed crash in OnSize() handler git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11915 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/menu/menu.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/samples/menu/menu.cpp b/samples/menu/menu.cpp index 29da4ca89f..dbe71040e2 100644 --- a/samples/menu/menu.cpp +++ b/samples/menu/menu.cpp @@ -253,6 +253,7 @@ MyFrame::MyFrame() : wxFrame((wxFrame *)NULL, -1, "wxWindows menu sample", wxDefaultPosition, wxSize(300, 200)) { + m_textctrl = NULL; m_menu = NULL; m_countDummy = 0; m_logOld = NULL; @@ -701,6 +702,9 @@ void MyFrame::OnRightUp(wxMouseEvent &event) void MyFrame::OnSize(wxSizeEvent& event) { + if ( !m_textctrl ) + return; + // leave a band below for popup menu testing wxSize size = GetClientSize(); m_textctrl->SetSize(0, 0, size.x, (3*size.y)/4); -- 2.47.2