mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-10 08:04:25 +02:00
Don't try to acquire lock if we do not have a source anymore.
This commit is contained in:
@@ -159,9 +159,15 @@ ControlConnection::registerSource()
|
|||||||
{
|
{
|
||||||
Q_D( ControlConnection );
|
Q_D( ControlConnection );
|
||||||
QReadLocker sourceLocker( &d->sourceLock );
|
QReadLocker sourceLocker( &d->sourceLock );
|
||||||
|
if ( d->source.isNull() )
|
||||||
|
{
|
||||||
|
// Not connected to a source anymore, nothing to do.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QSharedPointer<QMutexLocker> locker = d->source->acquireLock();
|
QSharedPointer<QMutexLocker> locker = d->source->acquireLock();
|
||||||
// Only continue if we are still the ControlConnection associated with this source.
|
// 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();
|
qDebug() << Q_FUNC_INFO << d->source->id();
|
||||||
Source* source = (Source*) sender();
|
Source* source = (Source*) sender();
|
||||||
|
Reference in New Issue
Block a user