From f4bd67593eae8df6e9a9eb0b7e1374833dbc2a70 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Wed, 15 May 2002 19:59:10 +0000 Subject: [PATCH] Don't call a function that might do drawing when setting a null image list (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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index 92610cada4..9b53eb766a 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -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) -- 2.47.2