Commit f7e0923d authored by Erwan Tulou's avatar Erwan Tulou
Browse files

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)
parent 50b04778
......@@ -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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment