]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't call a function that might do drawing when setting a null image list
authorJulian Smart <julian@anthemion.co.uk>
Wed, 15 May 2002 19:59:10 +0000 (19:59 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Wed, 15 May 2002 19:59:10 +0000 (19:59 +0000)
(might be deleting the tree control)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15577 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/treectlg.cpp

index 92610cada4526d6eea35ffb8916dfe2d922cc30d..9b53eb766a624c1ac143646390ced3bd12c10c85 100644 (file)
@@ -1861,7 +1861,10 @@ void wxGenericTreeCtrl::SetImageList(wxImageList *imageList)
     m_imageListNormal = imageList;
     m_ownsImageListNormal = FALSE;
     m_dirty = TRUE;
-    CalculateLineHeight();
+    // Don't do any drawing if we're setting the list to NULL,
+    // since we may be in the process of deleting the tree control.
+    if (imageList)
+        CalculateLineHeight();
 }
 
 void wxGenericTreeCtrl::SetStateImageList(wxImageList *imageList)