From 1c73dfa2db2539abc1b2b2ac3933c25e2e5d5d86 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Tue, 26 Nov 2013 14:28:44 +0000 Subject: [PATCH] correct behavior in case it is still used with ShowModal git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75296 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/aboutdlgg.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/generic/aboutdlgg.cpp b/src/generic/aboutdlgg.cpp index 2fe35a2800..9cb175334d 100644 --- a/src/generic/aboutdlgg.cpp +++ b/src/generic/aboutdlgg.cpp @@ -277,16 +277,24 @@ void wxGenericAboutDialog::AddCollapsiblePane(const wxString& title, void wxGenericAboutDialog::OnCloseWindow(wxCloseEvent& event) { - Destroy(); + // safeguards in case the window is still shown using ShowModal + if ( !IsModal() ) + Destroy(); event.Skip(); } -void wxGenericAboutDialog::OnOK(wxCommandEvent& WXUNUSED(event)) +void wxGenericAboutDialog::OnOK(wxCommandEvent& event) { - // By default a modeless dialog would be just hidden, destroy this one - // instead. - Destroy(); + // safeguards in case the window is still shown using ShowModal + if ( !IsModal() ) + { + // By default a modeless dialog would be just hidden, destroy this one + // instead. + Destroy(); + } + else + event.Skip(); } #endif // !wxUSE_MODAL_ABOUT_DIALOG