QTBUG-27809, fix multiple calls to QDBusPendingReply::waitForFinished on separate objects

This commit is contained in:
Than Ngo 2013-05-28 14:32:17 +02:00
parent 2d55e14904
commit 3e52db65d9
2 changed files with 64 additions and 1 deletions

View File

@ -0,0 +1,57 @@
commit 22b493d3523140e14df433cd8a49292b7f73f21c
Author: Peter Seiderer <Peter.Seiderer@gmx.de>
Date: Sat May 11 07:49:47 2013 +0200
Fix multiple calls to QDBusPendingReply::waitForFinished on separate objects
QTBUG-27809
Change-Id: If1691052ed1542e0e865c83df7b5737761a2bc86
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
index 96e4a12..1007f1a 100644
--- a/src/dbus/qdbusintegrator.cpp
+++ b/src/dbus/qdbusintegrator.cpp
@@ -1774,14 +1774,11 @@ void QDBusConnectionPrivate::waitForFinished(QDBusPendingCallPrivate *pcall)
pcall->waitForFinishedCondition.wait(&pcall->mutex);
} else {
pcall->waitingForFinished = true;
- pcall->mutex.unlock();
-
{
QDBusDispatchLocker locker(PendingCallBlockAction, this);
q_dbus_pending_call_block(pcall->pending);
- // QDBusConnectionPrivate::processFinishedCall() is called automatically
+ processFinishedCall(pcall);
}
- pcall->mutex.lock();
}
}
@@ -1789,8 +1786,6 @@ void QDBusConnectionPrivate::processFinishedCall(QDBusPendingCallPrivate *call)
{
QDBusConnectionPrivate *connection = const_cast<QDBusConnectionPrivate *>(call->connection);
- QMutexLocker locker(&call->mutex);
-
QDBusMessage &msg = call->replyMessage;
if (call->pending) {
// decode the message
@@ -1824,7 +1819,8 @@ void QDBusConnectionPrivate::processFinishedCall(QDBusPendingCallPrivate *call)
q_dbus_pending_call_unref(call->pending);
call->pending = 0;
- locker.unlock();
+ if (call->waitingForFinished)
+ call->waitForFinishedCondition.wakeAll();
// Are there any watchers?
if (call->watcherHelper)
@@ -2009,7 +2005,6 @@ QDBusPendingCallPrivate *QDBusConnectionPrivate::sendWithReplyAsync(const QDBusM
q_dbus_message_unref(msg);
pcall->pending = pending;
- q_dbus_pending_call_set_notify(pending, qDBusResultReceived, pcall, 0);
return pcall;
} else {

View File

@ -20,7 +20,7 @@ Summary: Qt toolkit
Name: qt
Epoch: 1
Version: 4.8.4
Release: 17%{?dist}
Release: 18%{?dist}
# See LGPL_EXCEPTIONS.txt, LICENSE.GPL3, respectively, for exception details
License: (LGPLv2 with exceptions or GPLv3 with exceptions) and ASL 2.0 and BSD and FTL and MIT
@ -134,6 +134,8 @@ Patch113: qt-everywhere-opensource-src-4.8.4-QTBUG-22829.patch
# QSslSocket may report incorrect errors when certificate verification fails
# https://codereview.qt-project.org/#change,42461
Patch154: 0054-Fix-binary-incompatibility-between-openssl-versions.patch
# https://codereview.qt-project.org/#change,55874
Patch155: qt-everywhere-opensource-src-4.8-QTBUG-27809.patch
## upstream git
# QSslSocket may report incorrect errors when certificate verification fails
@ -499,6 +501,7 @@ rm -fv mkspecs/linux-g++*/qmake.conf.multilib-optflags
%patch101 -p1 -b .QTBUG-29082
%patch102 -p1 -b .qgtkstyle_disable_gtk_theme_check
%patch113 -p1 -b .QTBUG-22829
%patch155 -p1 -b .QTBUG-27809
%patch254 -p1 -b .0054
%patch257 -p1 -b .0057
%patch267 -p1 -b .0067
@ -1182,6 +1185,9 @@ fi
%changelog
* Tue May 28 2013 Than Ngo <than@redhat.com> - 4.8.4-18
- QTBUG-27809, fix multiple calls to QDBusPendingReply::waitForFinished on separate objects
* Thu Apr 25 2013 Than Ngo <than@redhat.com> - 4.8.4-17
- Desktop file sanity, drop key "Encoding", it's deprecated