From 760fdb67552d34ba113d3a26186641bed0eb50d0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 30 Mar 2007 16:49:42 +0000 Subject: [PATCH] added check for index validity to OnTabButton() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45164 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/aui/auibook.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index dc73becd50..a30edc27f8 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -3572,9 +3572,11 @@ void wxAuiNotebook::OnTabButton(wxCommandEvent& command_evt) { close_wnd->Close(); } - else + else { int main_idx = m_tabs.GetIdxFromWindow(close_wnd); + wxCHECK_RET( main_idx != wxNOT_FOUND, _T("no page to delete?") ); + DeletePage(main_idx); } }