]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/tbarbase.cpp
Fix memory leak by letting the base class version handle the
[wxWidgets.git] / src / common / tbarbase.cpp
index d78bcf6fe8886713369a32749aa535d49b2a9da3..f04db4ad718a9e8357ebbc8fd68093355cad69b0 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     04/01/98
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart
-// Licence:     wxWindows licence
+// Licence:     wxWidgets licence
 /////////////////////////////////////////////////////////////////////////////
 
 // ============================================================================
@@ -41,7 +41,7 @@
 #include "wx/toolbar.h"
 
 // ----------------------------------------------------------------------------
-// wxWindows macros
+// wxWidgets macros
 // ----------------------------------------------------------------------------
 
 BEGIN_EVENT_TABLE(wxToolBarBase, wxControl)
@@ -623,7 +623,8 @@ void wxToolBarBase::UpdateWindowUI(long flags)
 
     // There is no sense in updating the toolbar UI
     // if the parent window is about to get destroyed
-    if (GetParent() && wxPendingDelete.Member( GetParent() ))
+    wxWindow *tlw = wxGetTopLevelParent( this );
+    if (tlw && wxPendingDelete.Member( tlw ))
         return;
 
     wxEvtHandler* evtHandler = GetEventHandler() ;