X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/556b8c1aab20985774000e1695e638539153edd7..a333f34d91ae845d39ca8a833290e9a1c3d04749:/samples/except/except.cpp?ds=sidebyside diff --git a/samples/except/except.cpp b/samples/except/except.cpp index 11972994af..a7f2d7ad94 100644 --- a/samples/except/except.cpp +++ b/samples/except/except.cpp @@ -27,9 +27,12 @@ // for all others, include the necessary headers (this file is usually all you // need because it includes almost all "standard" wxWindows headers) #ifndef WX_PRECOMP + #include "wx/log.h" + #include "wx/app.h" #include "wx/frame.h" #include "wx/dialog.h" + #include "wx/menu.h" #include "wx/button.h" #include "wx/sizer.h" @@ -267,9 +270,17 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnDialog(wxCommandEvent& WXUNUSED(event)) { - MyDialog dlg(this); + try + { + MyDialog dlg(this); - dlg.ShowModal(); + dlg.ShowModal(); + } + catch ( ... ) + { + Destroy(); + throw; + } } void MyFrame::OnThrowString(wxCommandEvent& WXUNUSED(event))