wxAuiNotebook problem Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Sickboy
Experienced Solver
Experienced Solver
Posts: 91
Joined: Wed Mar 16, 2005 10:30 pm
Location: Germany

wxAuiNotebook problem

Post by Sickboy » Tue Jun 05, 2007 9:21 am

I'm using wxAui in an MDI application with the undocumented classes wxAuiMDIParentFrame, wxAuiMDIChildFrame and wxAuiMDIClientWindow.
New documents will be opened in the wxAuiMDIClientWindow which is derived from the wxAuiNotebook.
This works fine so far. I can open and close a much documents as i want without problems.

BUT when i close the last tab of a wxAuiNotebook and try to open a new tab (document) again it crash in wxAuiNotebook::GetActiveCtrl().
This is the call stack:

Code: Select all

msvcr80d.dll!_heap_alloc_base(unsigned int size=804)  Zeile 105 + 0x28 Bytes	C
 	msvcr80d.dll!_heap_alloc_dbg(unsigned int nSize=768, int nBlockUse=1, const char * szFileName=0x00000000, int nLine=0)  Zeile 411 + 0x9 Bytes	C++
 	msvcr80d.dll!_nh_malloc_dbg(unsigned int nSize=768, int nhFlag=0, int nBlockUse=1, const char * szFileName=0x00000000, int nLine=0)  Zeile 268 + 0x15 Bytes	C++
 	msvcr80d.dll!malloc(unsigned int nSize=768)  Zeile 154 + 0x15 Bytes	C++
 	wxmsw28ud_core_vc_custom.dll!wxImage::Create(int width=16, int height=16, bool clear=false)  Zeile 189 + 0x13 Bytes	C++
 	wxmsw28ud_core_vc_custom.dll!wxImage::wxImage(int width=16, int height=16, bool clear=false)  Zeile 131	C++
 	wxmsw28ud_core_vc_custom.dll!wxDIB::ConvertToImage()  Zeile 746 + 0x12 Bytes	C++
 	wxmsw28ud_core_vc_custom.dll!wxBitmap::ConvertToImage()  Zeile 904 + 0xc Bytes	C++
 	wxmsw28ud_aui_vc_custom.dll!wxAuiBitmapFromBits(const unsigned char * bits=0x00d56004, int w=16, int h=16, const wxColour & color={...})  Zeile 127 + 0x3f Bytes	C++
 	wxmsw28ud_aui_vc_custom.dll!wxAuiDefaultTabArt::wxAuiDefaultTabArt()  Zeile 212 + 0x27 Bytes	C++
 	wxmsw28ud_aui_vc_custom.dll!wxAuiDefaultTabArt::Clone()  Zeile 233 + 0x25 Bytes	C++
 	wxmsw28ud_aui_vc_custom.dll!wxAuiNotebook::GetActiveTabCtrl()  Zeile 2942 + 0x29 Bytes	C++
 	wxmsw28ud_aui_vc_custom.dll!wxAuiNotebook::InsertPage(unsigned int page_idx=0, wxWindow * page=0x071b4fe0, const wxString & caption={...}, bool select=true, const wxBitmap & bitmap={...})  Zeile 2617 + 0x8 Bytes	C++
 	wxmsw28ud_aui_vc_custom.dll!wxAuiNotebook::AddPage(wxWindow * page=0x071b4fe0, const wxString & caption={...}, bool select=true, const wxBitmap & bitmap={...})  Zeile 2589	C++
 	wxmsw28ud_aui_vc_custom.dll!wxAuiMDIChildFrame::Create(wxAuiMDIParentFrame * parent=0x026fd540, int id=-1, const wxString & title={...}, const wxPoint & __formal={...}, const wxSize & size={...}, long style=0, const wxString & name={...})  Zeile 464	C++
 	wxmsw28ud_aui_vc_custom.dll!wxAuiMDIChildFrame::wxAuiMDIChildFrame(wxAuiMDIParentFrame * parent=0x026fd540, int id=-1, const wxString & title={...}, const wxPoint & __formal={...}, const wxSize & size={...}, long style=541072960, const wxString & name={...})  Zeile 414	C++
Any idea what is wrong ?

Sickboy
Experienced Solver
Experienced Solver
Posts: 91
Joined: Wed Mar 16, 2005 10:30 pm
Location: Germany

Post by Sickboy » Wed Jun 06, 2007 2:08 pm

I'm using wxMSW 2.8.4 and the solution is to add:

Code: Select all

tab_frame->m_tabs = NULL;
before

Code: Select all

delete tab_frame;
in

Code: Select all

wxAuiNotebook::RemoveEmptyTabFrames()

bwilliams
Knows some wx things
Knows some wx things
Posts: 34
Joined: Mon Dec 19, 2005 3:30 pm

Post by bwilliams » Thu Jun 28, 2007 1:01 pm

Hi,

I've fixed this problem in the wxWidgets 2.8 branch and trunk.

Thanks for the report.

Ben

Post Reply