diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-02-02 22:06:11 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-03 14:38:30 +0100 |
commit | 7f3ec6bf00238a51c349c663c3fd24ac89fd500c (patch) | |
tree | af1faae9c3f228a1e53c7316a235fec314216122 /src | |
parent | 59eaf59103c2cc78ddd9972f410ef1ea43077e22 (diff) |
Fix nasty bug in property cache leading to inaccessible signal parameters
The property cache among other things caches the parameter types and names
of signals (instead of retrieving them from the meta-object each time). When
this cache is created through createArgumentsObject(), the parameter names have
to be provided, but the signature didn't enforce that because of the parameter
names having a default value of an empty list. All call sites however provided
the correct list, except for one in QQmlPropertyCache::methodParameterTypes.
Consequently tst_qqmlecmascript::threadSignal() would fail occasionally because
the first time this cache was "created" was when the "done" signal was emitted,
which caused QQmlBoundSignalExpression::evaluate to call methodParameterTypes. If
the signal data had not been cached so far, a new cache with an empty parameter
name list was created.
Later (in the second half of the test) a new signal handler was compiled and
the property cache reported that the signal took no parameters.
Change-Id: I19230d0fb1ddd54992f3d6251f82c489626662e7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/qml/qqmlpropertycache.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlpropertycache_p.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlpropertycache.cpp b/src/qml/qml/qqmlpropertycache.cpp index 0247cebdc5..a0af0e94ef 100644 --- a/src/qml/qml/qqmlpropertycache.cpp +++ b/src/qml/qml/qqmlpropertycache.cpp @@ -1195,7 +1195,7 @@ int *QQmlPropertyCache::methodParameterTypes(QObject *object, int index, int argc = m.parameterCount(); if (!rv->arguments) { - A *args = c->createArgumentsObject(argc); + A *args = c->createArgumentsObject(argc, m.parameterNames()); rv->arguments = args; } A *args = static_cast<A *>(rv->arguments); diff --git a/src/qml/qml/qqmlpropertycache_p.h b/src/qml/qml/qqmlpropertycache_p.h index a6741d3bd9..fe7f204e87 100644 --- a/src/qml/qml/qqmlpropertycache_p.h +++ b/src/qml/qml/qqmlpropertycache_p.h @@ -351,7 +351,7 @@ private: QQmlPropertyData::Flag signalFlags = QQmlPropertyData::NoFlags); QQmlPropertyCacheMethodArguments *createArgumentsObject(int count, - const QList<QByteArray> &names = QList<QByteArray>()); + const QList<QByteArray> &names); QQmlPropertyData *signal(int, QQmlPropertyCache **) const; typedef QVector<QQmlPropertyData> IndexCache; |