m_inSwitchPage = FALSE;
m_imageList = (wxImageList *) NULL;
- m_pagesData.DeleteContents( TRUE );
m_selection = -1;
m_themeEnabled = TRUE;
}
{
wxCHECK_MSG( m_widget != NULL, -1, wxT("invalid notebook") );
- wxCHECK_MSG( page < (int)m_pagesData.GetCount(), -1, wxT("invalid notebook index") );
+ wxCHECK_MSG( page >= 0 && page < (int)m_pagesData.GetCount(), -1, wxT("invalid notebook index") );
int selOld = GetSelection();
gtk_notebook_remove_page( GTK_NOTEBOOK(m_widget), page );
- m_pagesData.DeleteObject(GetNotebookPage(page));
+ wxGtkNotebookPage* p = GetNotebookPage(page);
+ m_pagesData.DeleteObject(p);
+ delete p;
return client;
}