Commit 5b3a8cf5 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Fixed deadlock in SettingsManager

parent c6d71cae
...@@ -64,8 +64,12 @@ void SettingsManager::setValue( const QString& part , const QString& key, const ...@@ -64,8 +64,12 @@ void SettingsManager::setValue( const QString& part , const QString& key, const
{ {
m_globalLock.lockForRead(); m_globalLock.lockForRead();
if ( !m_tempData.contains( part ) ) if ( !m_tempData.contains( part ) )
{
m_globalLock.unlock();
addNewSettingsPart( part ); addNewSettingsPart( part );
m_globalLock.unlock(); }
else
m_globalLock.unlock();
QWriteLocker lock( &m_globalLock ); QWriteLocker lock( &m_globalLock );
SettingsPart* tmp = m_tempData[part]; SettingsPart* tmp = m_tempData[part];
SettingsPart::ConfigPair::iterator it = tmp->m_data.find( key ); SettingsPart::ConfigPair::iterator it = tmp->m_data.find( key );
......
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