1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-03 23:52:25 +02:00

* Prevent dead-locking.

This commit is contained in:
Christian Muehlhaeuser 2012-06-20 22:01:08 +02:00
parent 6cd80cf047
commit c2dd22ed40

View File

@ -438,10 +438,15 @@ Source::executeCommands()
return;
}
QMutexLocker lock( &m_cmdMutex );
if ( !m_cmds.isEmpty() )
bool commandsAvail = false;
{
QMutexLocker lock( &m_cmdMutex );
commandsAvail = !m_cmds.isEmpty();
}
if ( commandsAvail )
{
QMutexLocker lock( &m_cmdMutex );
QList< QSharedPointer<DatabaseCommand> > cmdGroup;
QSharedPointer<DatabaseCommand> cmd = m_cmds.takeFirst();
while ( cmd->groupable() )