From 18b40f302243480a3f379af33fa04c3158af92c2 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Tue, 21 Aug 2007 16:56:39 +0000 Subject: [PATCH] Avoid selecting/updating in destructor git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48306 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/aui/auibook.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index f387d6ed67..113fb0c5c4 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -2865,6 +2865,9 @@ void wxAuiNotebook::InitNotebook(long style) wxAuiNotebook::~wxAuiNotebook() { + // Indicate we're deleting pages + m_isBeingDeleted = true; + while ( GetPageCount() > 0 ) DeletePage(0); @@ -3225,7 +3228,7 @@ bool wxAuiNotebook::RemovePage(size_t page_idx) RemoveEmptyTabFrames(); // set new active pane - if (new_active) + if (new_active && !m_isBeingDeleted) { m_curpage = -1; SetSelectionToWindow(new_active); @@ -4104,7 +4107,8 @@ void wxAuiNotebook::RemoveEmptyTabFrames() m_mgr.GetPane(first_good).Centre(); } - m_mgr.Update(); + if (!m_isBeingDeleted) + m_mgr.Update(); } void wxAuiNotebook::OnChildFocusNotebook(wxChildFocusEvent& evt) -- 2.50.0