1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 14:16:32 +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; return;
} }
QMutexLocker lock( &m_cmdMutex ); bool commandsAvail = false;
if ( !m_cmds.isEmpty() )
{ {
QMutexLocker lock( &m_cmdMutex );
commandsAvail = !m_cmds.isEmpty();
}
if ( commandsAvail )
{
QMutexLocker lock( &m_cmdMutex );
QList< QSharedPointer<DatabaseCommand> > cmdGroup; QList< QSharedPointer<DatabaseCommand> > cmdGroup;
QSharedPointer<DatabaseCommand> cmd = m_cmds.takeFirst(); QSharedPointer<DatabaseCommand> cmd = m_cmds.takeFirst();
while ( cmd->groupable() ) while ( cmd->groupable() )