]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/tbarbase.cpp
initialize m_initialized to false to avoid spurious asserts
[wxWidgets.git] / src / common / tbarbase.cpp
index 62ec150e49507b44c7c80d442ebe4738560e3279..d2243fedf2cd3b1f25719b798484aaa997b5dff1 100644 (file)
@@ -59,6 +59,8 @@ WX_DEFINE_LIST(wxToolBarToolsList);
 // wxToolBarToolBase
 // ----------------------------------------------------------------------------
 
+IMPLEMENT_DYNAMIC_CLASS(wxToolBarToolBase, wxObject)   
+
 bool wxToolBarToolBase::Enable(bool enable)
 {
     if ( m_enabled == enable )
@@ -619,6 +621,12 @@ void wxToolBarBase::UpdateWindowUI(long flags)
 {
     wxWindowBase::UpdateWindowUI(flags);
 
+    // There is no sense in updating the toolbar UI
+    // if the parent window is about to get destroyed
+    wxWindow *tlw = wxGetTopLevelParent( this );
+    if (tlw && wxPendingDelete.Member( tlw ))
+        return;
+
     wxEvtHandler* evtHandler = GetEventHandler() ;
 
     for ( wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst();