From: Vadim Zeitlin Date: Sat, 20 Sep 2003 16:23:51 +0000 (+0000) Subject: destroy the frame if the exception occurs in a dialog shown from it X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/df5a063f61798de07e13b5727a7a868ac568e3a3?ds=inline destroy the frame if the exception occurs in a dialog shown from it git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23744 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- 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))