Make sure the QDBusVirtualObject virtuals are called in the right thread

Change-Id: I42e7ef1a481840699a8dffff1409e30f191e822f
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
This commit is contained in:
Thiago Macieira 2015-10-04 01:00:09 -04:00
parent 844ea8beea
commit 50723bf3d0

View File

@ -407,6 +407,7 @@ public:
VirtualObject() :success(true) {}
QString introspect(const QString &path) const {
Q_ASSERT(QThread::currentThread() == thread());
if (path == "/some/path/superNode")
return "zitroneneis";
if (path == "/some/path/superNode/foo")
@ -417,6 +418,7 @@ public:
}
bool handleMessage(const QDBusMessage &message, const QDBusConnection &connection) {
Q_ASSERT(QThread::currentThread() == thread());
++callCount;
lastMessage = message;