[vlc-devel] commit: skins2: ensure the new SubX default skins doesn't crash on exit ( Erwan Tulou )

git version control git at videolan.org
Tue Jun 23 00:13:04 CEST 2009


vlc | branch: 1.0-bugfix | Erwan Tulou <erwan10 at videolan.org> | Mon Jun 22 23:24:51 2009 +0200| [888b77d584e3a70d2fb8c2d872c1535dd36503aa] | committer: Erwan Tulou 

skins2: ensure the new SubX default skins doesn't crash on exit

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)
(cherry picked from commit f7e0923d25fc95597ea70404a23932fdfec83c7c)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=888b77d584e3a70d2fb8c2d872c1535dd36503aa
---

 modules/gui/skins2/src/var_manager.cpp |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/gui/skins2/src/var_manager.cpp b/modules/gui/skins2/src/var_manager.cpp
index 50837ef..0dd1853 100644
--- a/modules/gui/skins2/src/var_manager.cpp
+++ b/modules/gui/skins2/src/var_manager.cpp
@@ -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,




More information about the vlc-devel mailing list