]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/listctrl.cpp
prevent memory leak
[wxWidgets.git] / src / generic / listctrl.cpp
index eb553e13284246cc89ac8fee169697e7ff3453a5..7bb81d14919c2f776d56678db576473388cf0da5 100644 (file)
@@ -4189,9 +4189,9 @@ void wxListMainWindow::RecalculatePositions(bool noRefresh)
     const size_t count = GetItemCount();
 
     int iconSpacing;
-    if ( HasFlag(wxLC_ICON) )
+    if ( HasFlag(wxLC_ICON) && m_normal_image_list )
         iconSpacing = m_normal_spacing;
-    else if ( HasFlag(wxLC_SMALL_ICON) )
+    else if ( HasFlag(wxLC_SMALL_ICON) && m_small_image_list )
         iconSpacing = m_small_spacing;
     else
         iconSpacing = 0;