]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/treectlg.cpp
unselected the current item when unfocusing it in a single selection list control...
[wxWidgets.git] / 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)