diff --git a/samples/except/except.cpp b/samples/except/except.cpp index 6f8a0acbbe..a7f2d7ad94 100644 --- a/samples/except/except.cpp +++ b/samples/except/except.cpp @@ -270,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))