X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ce7fe42e848cc0c9058dae906c3a7bded50681e6..9c34a216817028bc533e07873d047208a96b05a2:/include/wx/simplebook.h diff --git a/include/wx/simplebook.h b/include/wx/simplebook.h index 9b6474b0c4..795391466c 100644 --- a/include/wx/simplebook.h +++ b/include/wx/simplebook.h @@ -156,8 +156,15 @@ protected: virtual wxWindow *DoRemovePage(size_t page) { - m_pageTexts.erase(m_pageTexts.begin() + page); - return wxBookCtrlBase::DoRemovePage(page); + wxWindow* const win = wxBookCtrlBase::DoRemovePage(page); + if ( win ) + { + m_pageTexts.erase(m_pageTexts.begin() + page); + + DoSetSelectionAfterRemoval(page); + } + + return win; } virtual void DoSize()