From: Olivier Teulière Date: Mon, 17 Apr 2006 15:23:13 +0000 (+0000) Subject: * skins2/controls/ctrl_tree.cpp: Check that the iterator is not end() before using... X-Git-Tag: 0.9.0-test0~11486 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=efad303f0f10a04b28ab6ba7c5891eb6c13df39a;p=vlc * skins2/controls/ctrl_tree.cpp: Check that the iterator is not end() before using it... This fixes random freezes when loading skins with a PlayTree control on Windows, and probably some crashes as well. --- diff --git a/modules/gui/skins2/controls/ctrl_tree.cpp b/modules/gui/skins2/controls/ctrl_tree.cpp index c2406b95b8..108d1ff7bd 100644 --- a/modules/gui/skins2/controls/ctrl_tree.cpp +++ b/modules/gui/skins2/controls/ctrl_tree.cpp @@ -771,7 +771,7 @@ void CtrlTree::makeImage() { it = m_flat ? m_rTree.getNextLeaf( it ) : m_rTree.getNextVisibleItem( it ); - } while( it->m_deleted ); + } while( it != m_rTree.end() && it->m_deleted ); } } } @@ -859,7 +859,7 @@ void CtrlTree::makeImage() do { it = m_flat ? m_rTree.getNextLeaf( it ) : m_rTree.getNextVisibleItem( it ); - } while( it->m_deleted ); + } while( it != m_rTree.end() && it->m_deleted ); } stats_TimerStop( getIntf(), STATS_TIMER_SKINS_PLAYTREE_IMAGE ); }