diff --git a/src/libtomahawk/Source.cpp b/src/libtomahawk/Source.cpp index 5c4de0e1a..38bef3265 100644 --- a/src/libtomahawk/Source.cpp +++ b/src/libtomahawk/Source.cpp @@ -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 > cmdGroup; QSharedPointer cmd = m_cmds.takeFirst(); while ( cmd->groupable() )