]> git.sesse.net Git - vlc/commitdiff
skins2: ensure the new SubX default skins doesn't crash on exit
authorErwan Tulou <erwan10@videolan.org>
Mon, 22 Jun 2009 21:24:51 +0000 (23:24 +0200)
committerErwan Tulou <erwan10@videolan.org>
Mon, 22 Jun 2009 22:09:39 +0000 (00:09 +0200)
SubX crashed on both Linux and Windows in a set::erase call (STL) when releasing C++ objects. Swapping two loops solved it. (the second loop was referencing variables released in the first loop). This makes SubX terminate nicely, but doesn't solve all crashes for skins2. (more cleanup to do)

modules/gui/skins2/src/var_manager.cpp

index 50837efaf87e33a00a18bc1c9028df0ae486d5b9..0dd18532170191202c40ca30909446f745c597cc 100644 (file)
@@ -35,6 +35,12 @@ VarManager::VarManager( intf_thread_t *pIntf ): SkinObject( pIntf ),
 
 VarManager::~VarManager()
 {
+    // Delete the anonymous variables
+    while( !m_anonVarList.empty() )
+    {
+        m_anonVarList.pop_back();
+    }
+
     // Delete the variables in the reverse order they were added
     list<string>::const_iterator it1;
     for( it1 = m_varList.begin(); it1 != m_varList.end(); it1++ )
@@ -42,12 +48,6 @@ VarManager::~VarManager()
         m_varMap.erase(*it1);
     }
 
-    // Delete the anonymous variables
-    while( !m_anonVarList.empty() )
-    {
-        m_anonVarList.pop_back();
-    }
-
     delete m_pTooltipText;
 
     // Warning! the help text must be the last variable to be deleted,