1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-02-27 05:12:34 +01:00

Don't try to acquire lock if we do not have a source anymore.

This commit is contained in:
Uwe L. Korn 2013-06-26 19:36:14 +02:00
parent 968ac83906
commit 91d0a676ec

View File

@ -159,9 +159,15 @@ ControlConnection::registerSource()
{
Q_D( ControlConnection );
QReadLocker sourceLocker( &d->sourceLock );
if ( d->source.isNull() )
{
// Not connected to a source anymore, nothing to do.
return;
}
QSharedPointer<QMutexLocker> locker = d->source->acquireLock();
// Only continue if we are still the ControlConnection associated with this source.
if ( !d->source.isNull() && d->source->controlConnection() == this )
if ( d->source->controlConnection() == this )
{
qDebug() << Q_FUNC_INFO << d->source->id();
Source* source = (Source*) sender();