aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qqmltypecompiler_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-01-17 12:16:07 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-20 11:49:42 +0100
commit65a02ef32f7131f5e0b87dd18b4f81486d507ae3 (patch)
tree07bcb66e6f18641991e5f8532a5e5503780bdfee /src/qml/compiler/qqmltypecompiler_p.h
parent3a9e7f056f487c9740621750067781d33a7c9f34 (diff)
[new compiler] Fix refcounting leaks with property caches
The TypeReference is not copy-safe, as it holds refcounted property cache pointers. For the new compiler code path, don't copy them but keep pointers to TypeReference objects around. Also make sure to ref the root property cache correctly and avoid the unnecessary addref for the property cache when creating new vme meta objects (initial refcount is 1). Change-Id: I0c4b952c8300c2167d926d9c35b8579fd505d596 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qqmltypecompiler_p.h')
-rw-r--r--src/qml/compiler/qqmltypecompiler_p.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/compiler/qqmltypecompiler_p.h b/src/qml/compiler/qqmltypecompiler_p.h
index 4fde8f58c2..e6a34fa376 100644
--- a/src/qml/compiler/qqmltypecompiler_p.h
+++ b/src/qml/compiler/qqmltypecompiler_p.h
@@ -81,7 +81,7 @@ struct QQmlTypeCompiler
QQmlEnginePrivate *enginePrivate() const { return engine; }
const QQmlImports *imports() const;
- QHash<int, QQmlCompiledData::TypeReference> *resolvedTypes();
+ QHash<int, QQmlCompiledData::TypeReference *> *resolvedTypes();
QList<QtQml::QmlObject*> *qmlObjects();
int rootObjectIndex() const;
void setPropertyCaches(const QVector<QQmlPropertyCache *> &caches);
@@ -130,7 +130,7 @@ protected:
QQmlEnginePrivate *enginePrivate;
const QList<QtQml::QmlObject*> &qmlObjects;
const QQmlImports *imports;
- QHash<int, QQmlCompiledData::TypeReference> *resolvedTypes;
+ QHash<int, QQmlCompiledData::TypeReference*> *resolvedTypes;
QVector<QByteArray> vmeMetaObjects;
QVector<QQmlPropertyCache*> propertyCaches;
};
@@ -165,7 +165,7 @@ protected:
QHash<int, int> *_objectIndexToIdInScope;
QList<int> _objectsWithAliases;
- QHash<int, QQmlCompiledData::TypeReference> *resolvedTypes;
+ QHash<int, QQmlCompiledData::TypeReference*> *resolvedTypes;
const QVector<QQmlPropertyCache *> propertyCaches;
QVector<QByteArray> *vmeMetaObjectData;
QHash<int, int> *objectIndexToIdForRoot;
@@ -190,7 +190,7 @@ private:
bool isComponent(int objectIndex) const { return objectIndexToIdPerComponent.contains(objectIndex); }
const QV4::CompiledData::QmlUnit *qmlUnit;
- const QHash<int, QQmlCompiledData::TypeReference> &resolvedTypes;
+ const QHash<int, QQmlCompiledData::TypeReference*> &resolvedTypes;
const QVector<QQmlPropertyCache *> &propertyCaches;
const QHash<int, QHash<int, int> > objectIndexToIdPerComponent;
QHash<int, QByteArray> *customParserData;