From df5a063f61798de07e13b5727a7a868ac568e3a3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 20 Sep 2003 16:23:51 +0000 Subject: [PATCH] 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 --- samples/except/except.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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)) -- 2.45.2