summaryrefslogtreecommitdiffstats
path: root/src/dbus/qdbusabstractinterface_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-01-02 14:35:15 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-02 16:15:10 +0100
commitc2e2e0151e51b5870f41c993d4c7f3a3c16e5405 (patch)
tree58f1a7c2aa32a3e7ec48fe74746cbcc8ba71abf2 /src/dbus/qdbusabstractinterface_p.h
parent68974f31ff12b04580a1d18a56994212d9af56a9 (diff)
Fix crashes when calling into qdbus interfaces from QML
The meta-call convention for reading properties differs between Qml and QDBus. QML expects only to provide a pointer to the return value in args[0]. That is also how the metacall was originally introduced in Qt 4. QDBus also expects that the caller allocates a QVariant and provides a pointer to it in a[2], in addition to a[1] being a pointer to an int that is used to report where the return value can be found (in where a[0] points to or the variant in a[1]) - this is useful to report errors when reading the property by clearing the variant. For performance reasons, QML avoids the creation of a QVariant when reading properties. As however QDBus expects it, a crash occurs. This patch changes the QDBus metacall implementation to not rely on the caller to provide a QVariant. Task-number: QTBUG-15052 Change-Id: I2f2c5b3ef2c1d93cc72eee1fa32a95d299a104c0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/dbus/qdbusabstractinterface_p.h')
-rw-r--r--src/dbus/qdbusabstractinterface_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dbus/qdbusabstractinterface_p.h b/src/dbus/qdbusabstractinterface_p.h
index 05ca04e3ef..e696781cdc 100644
--- a/src/dbus/qdbusabstractinterface_p.h
+++ b/src/dbus/qdbusabstractinterface_p.h
@@ -89,7 +89,7 @@ public:
bool canMakeCalls() const;
// these functions do not check if the property is valid
- void property(const QMetaProperty &mp, QVariant &where) const;
+ bool property(const QMetaProperty &mp, void *returnValuePtr) const;
bool setProperty(const QMetaProperty &mp, const QVariant &value);
// return conn's d pointer