aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2012-08-28 10:48:50 +1000
committerQt by Nokia <qt-info@nokia.com>2012-08-28 04:32:48 +0200
commit7223f1861d3309d336123c90866665cfe2507d7f (patch)
tree66c926fe85b8e08b6d79eebc36ec2d124e7b3453 /src
parent70a2c0491d66aa05f9e9e67f8a845f4df84da857 (diff)
Fix leak introduced in 0853343c33e394f35c31c161b019b2aed17f9256.
Change-Id: I7e23f2ba8e7ecbcfaddce1ac4224434aa5fbe69b Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/qml/qml/qqmlpropertycache.cpp15
-rw-r--r--src/qml/qml/qqmlpropertycache_p.h4
2 files changed, 12 insertions, 7 deletions
diff --git a/src/qml/qml/qqmlpropertycache.cpp b/src/qml/qml/qqmlpropertycache.cpp
index 9165f890c7..50674fa1e4 100644
--- a/src/qml/qml/qqmlpropertycache.cpp
+++ b/src/qml/qml/qqmlpropertycache.cpp
@@ -887,17 +887,18 @@ void QQmlPropertyCache::update(QQmlEngine *engine, const QMetaObject *metaObject
This is different from QMetaMethod::methodIndex().
*/
QQmlPropertyData *
-QQmlPropertyCache::signal(int index) const
+QQmlPropertyCache::signal(int index, QQmlPropertyCache **c) const
{
if (index < 0 || index >= (signalHandlerIndexCacheStart + signalHandlerIndexCache.count()))
return 0;
if (index < signalHandlerIndexCacheStart)
- return _parent->signal(index);
+ return _parent->signal(index, c);
QQmlPropertyData *rv = const_cast<QQmlPropertyData *>(&methodIndexCache.at(index - signalHandlerIndexCacheStart));
if (rv->notFullyResolved()) resolve(rv);
Q_ASSERT(rv->isSignal() || rv->coreIndex == -1);
+ if (c) *c = const_cast<QQmlPropertyCache *>(this);
return rv;
}
@@ -1066,7 +1067,8 @@ static int EnumType(const QMetaObject *metaobj, const QByteArray &str, int type)
*/
QString QQmlPropertyCache::signalParameterStringForJS(int index, int *count, QString *errorString)
{
- QQmlPropertyData *signalData = signal(index);
+ QQmlPropertyCache *c = 0;
+ QQmlPropertyData *signalData = signal(index, &c);
if (!signalData)
return QString();
@@ -1098,6 +1100,8 @@ QString QQmlPropertyCache::signalParameterStringForJS(int index, int *count, QSt
args->parameterError = false;
args->names = new QList<QByteArray>(parameterNameList);
signalData->arguments = args;
+ args->next = c->argumentsCache;
+ c->argumentsCache = args;
}
QQmlRewrite::RewriteSignalHandler rewriter;
@@ -1158,6 +1162,8 @@ int *QQmlPropertyCache::methodParameterTypes(QObject *object, int index,
args->parameterError = false;
args->names = 0;
rv->arguments = args;
+ args->next = c->argumentsCache;
+ c->argumentsCache = args;
}
A *args = static_cast<A *>(rv->arguments);
@@ -1183,9 +1189,6 @@ int *QQmlPropertyCache::methodParameterTypes(QObject *object, int index,
args->arguments[ii + 1] = type;
}
args->argumentsValid = true;
-
- args->next = c->argumentsCache;
- c->argumentsCache = args;
return static_cast<A *>(rv->arguments)->arguments;
} else {
diff --git a/src/qml/qml/qqmlpropertycache_p.h b/src/qml/qml/qqmlpropertycache_p.h
index e846590a85..ad94ed4688 100644
--- a/src/qml/qml/qqmlpropertycache_p.h
+++ b/src/qml/qml/qqmlpropertycache_p.h
@@ -285,7 +285,7 @@ public:
QQmlPropertyData *property(int) const;
QQmlPropertyData *method(int) const;
- QQmlPropertyData *signal(int) const;
+ QQmlPropertyData *signal(int index) const { return signal(index, 0); }
int methodIndexToSignalIndex(int) const;
QStringList propertyNames() const;
@@ -345,6 +345,8 @@ private:
// Implemented in v8/qv8qobjectwrapper.cpp
v8::Local<v8::Object> newQObject(QObject *, QV8Engine *);
+ QQmlPropertyData *signal(int, QQmlPropertyCache **) const;
+
typedef QVector<QQmlPropertyData> IndexCache;
typedef QStringMultiHash<QPair<int, QQmlPropertyData *> > StringCache;
typedef QVector<int> AllowedRevisionCache;