mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-02-26 21:03:31 +01:00
Don't try to acquire lock if we do not have a source anymore.
This commit is contained in:
parent
968ac83906
commit
91d0a676ec
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user