]> git.sesse.net Git - vlc/commitdiff
* skins2/controls/ctrl_tree.cpp: Check that the iterator is not end() before using...
authorOlivier Teulière <ipkiss@videolan.org>
Mon, 17 Apr 2006 15:23:13 +0000 (15:23 +0000)
committerOlivier Teulière <ipkiss@videolan.org>
Mon, 17 Apr 2006 15:23:13 +0000 (15:23 +0000)
   This fixes random freezes when loading skins with a PlayTree control on Windows, and probably some crashes as well.

modules/gui/skins2/controls/ctrl_tree.cpp

index c2406b95b8aecf2ed8bf54678474ac89a3a9393d..108d1ff7bd780463d5a7bde7dd1b27f82af06bdb 100644 (file)
@@ -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 );
 }