]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed crash in OnSize() handler
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 10 Oct 2001 00:11:23 +0000 (00:11 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 10 Oct 2001 00:11:23 +0000 (00:11 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11915 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/menu/menu.cpp

index 29da4ca89fa233705cb0d48bcad27fb1b96ddc3e..dbe71040e246d3475ab699380a90dd5172d9dbd4 100644 (file)
@@ -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);