Commit 9e76fdbc authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Skins2: blind attempt to fix a ThemeRepository crash

Top crash on Skins2 module on Win32
parent ec7e4d53
...@@ -73,6 +73,7 @@ ThemeRepository::ThemeRepository( intf_thread_t *pIntf ): SkinObject( pIntf ) ...@@ -73,6 +73,7 @@ ThemeRepository::ThemeRepository( intf_thread_t *pIntf ): SkinObject( pIntf )
// retrieve skins from skins directories and locate default skins // retrieve skins from skins directories and locate default skins
map<string,string>::const_iterator itmap, itdefault; map<string,string>::const_iterator itmap, itdefault;
bool b_default_found = false;
for( itmap = m_skinsMap.begin(); itmap != m_skinsMap.end(); ++itmap ) for( itmap = m_skinsMap.begin(); itmap != m_skinsMap.end(); ++itmap )
{ {
string name = itmap->first; string name = itmap->first;
...@@ -83,7 +84,10 @@ ThemeRepository::ThemeRepository( intf_thread_t *pIntf ): SkinObject( pIntf ) ...@@ -83,7 +84,10 @@ ThemeRepository::ThemeRepository( intf_thread_t *pIntf ): SkinObject( pIntf )
&text ); &text );
if( name == "Default" ) if( name == "Default" )
{
itdefault = itmap; itdefault = itmap;
b_default_found = true;
}
} }
// retrieve last skins stored or skins requested by user // retrieve last skins stored or skins requested by user
...@@ -98,7 +102,7 @@ ThemeRepository::ThemeRepository( intf_thread_t *pIntf ): SkinObject( pIntf ) ...@@ -98,7 +102,7 @@ ThemeRepository::ThemeRepository( intf_thread_t *pIntf ): SkinObject( pIntf )
current.c_str(), b_readable ? "" : "NOT" ); current.c_str(), b_readable ? "" : "NOT" );
// set the default skins if given skins not accessible // set the default skins if given skins not accessible
if( !b_readable ) if( !b_readable && b_default_found )
current = itdefault->second; current = itdefault->second;
// save this valid skins for reuse // save this valid skins for reuse
......
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