wxAuiManager::~wxAuiManager()
{
- int i;
- for (i = 0; i < m_panes.Count(); i++ )
+ for ( size_t i = 0; i < m_panes.size(); i++ )
{
- wxAuiPaneInfo& pinfo = m_panes.Item(i);
- if (pinfo.window && pinfo.window->GetParent() == 0)
+ wxAuiPaneInfo& pinfo = m_panes[i];
+ if (pinfo.window && !pinfo.window->GetParent())
delete pinfo.window;
}
void wxAuiManager::OnRender(wxAuiManagerEvent& evt)
{
+ // if the frame is about to be deleted, don't bother
+ if (!m_frame || wxPendingDelete.Member(m_frame))
+ return;
+
wxDC* dc = evt.GetDC();
#ifdef __WXMAC__