]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Cross port from local Mailody copy:
authorTom Albers <toma@kde.org>
Tue, 22 Sep 2009 19:18:04 +0000 (19:18 +0000)
committerTom Albers <toma@kde.org>
Tue, 22 Sep 2009 19:18:04 +0000 (19:18 +0000)
    SVN commit 1026747 by vkrause:

    Fix deadlock when changing the rating and the comment of the same
    object, in that order. The harmless looking setEnabled() call two lines
    down from here triggers a convoluted chain of (q)events that eventually
    ends up calling a method that tries to lock the mutex itself.

Thanks Volker!
CCMAIL:vkrausse@kde.org

svn path=/trunk/KDE/kdebase/apps/; revision=1026888

src/panels/information/metadatawidget.cpp

index 6a2f6073a42aa37e0addd68657029b7fbbdaa624..ea550ed52ac86fb225f5aeab3ca98a0277993ff0 100644 (file)
@@ -297,6 +297,7 @@ void MetaDataWidget::slotCommentChanged( const QString& s )
 
     QMutexLocker locker( &d->mutex );
     Nepomuk::MassUpdateJob* job = Nepomuk::MassUpdateJob::commentResources( d->sharedData.files.values(), s );
+    locker.unlock();
     connect( job, SIGNAL( result( KJob* ) ),
              this, SLOT( metadataUpdateDone() ) );
     setEnabled( false ); // no updates during execution
@@ -314,6 +315,7 @@ void MetaDataWidget::slotRatingChanged(unsigned int rating)
 #ifdef HAVE_NEPOMUK
     QMutexLocker locker( &d->mutex );
     Nepomuk::MassUpdateJob* job = Nepomuk::MassUpdateJob::rateResources( d->sharedData.files.values(), rating );
+    locker.unlock();
     connect( job, SIGNAL( result( KJob* ) ),
              this, SLOT( metadataUpdateDone() ) );
     setEnabled( false ); // no updates during execution