wxNotebook::RemovePage() now only gives critical assert failures instead of crashing
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7243 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -521,7 +521,7 @@ bool wxNotebook::DeletePage( int page )
|
||||
if (!nb_page) return FALSE;
|
||||
|
||||
/* GTK sets GtkNotebook.cur_page to NULL before sending
|
||||
the switvh page event */
|
||||
the switch page event */
|
||||
m_lastSelection = GetSelection();
|
||||
|
||||
nb_page->m_client->Destroy();
|
||||
@@ -536,10 +536,12 @@ bool wxNotebook::RemovePage( int page )
|
||||
{
|
||||
wxGtkNotebookPage* nb_page = GetNotebookPage(page);
|
||||
|
||||
if (!nb_page) return FALSE;
|
||||
wxCHECK_MSG( nb_page, FALSE, _T("wxNotebook::RemovePage: invalid page") );
|
||||
|
||||
gtk_notebook_remove_page( GTK_NOTEBOOK(m_widget), page );
|
||||
|
||||
nb_page->m_client->Destroy();
|
||||
|
||||
m_pages.DeleteObject( nb_page );
|
||||
|
||||
return TRUE;
|
||||
|
@@ -521,7 +521,7 @@ bool wxNotebook::DeletePage( int page )
|
||||
if (!nb_page) return FALSE;
|
||||
|
||||
/* GTK sets GtkNotebook.cur_page to NULL before sending
|
||||
the switvh page event */
|
||||
the switch page event */
|
||||
m_lastSelection = GetSelection();
|
||||
|
||||
nb_page->m_client->Destroy();
|
||||
@@ -536,10 +536,12 @@ bool wxNotebook::RemovePage( int page )
|
||||
{
|
||||
wxGtkNotebookPage* nb_page = GetNotebookPage(page);
|
||||
|
||||
if (!nb_page) return FALSE;
|
||||
wxCHECK_MSG( nb_page, FALSE, _T("wxNotebook::RemovePage: invalid page") );
|
||||
|
||||
gtk_notebook_remove_page( GTK_NOTEBOOK(m_widget), page );
|
||||
|
||||
nb_page->m_client->Destroy();
|
||||
|
||||
m_pages.DeleteObject( nb_page );
|
||||
|
||||
return TRUE;
|
||||
|
Reference in New Issue
Block a user