diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-09-07 06:02:33 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-09-07 06:02:33 (GMT) |
commit | c00ad8c6ba4b345b434aaedc7807e20b2fa64d3c (patch) | |
tree | ff385c8de7057ad22f1392ff7ab1264da644b7cd /src/declarative | |
parent | f0e17231d1b8ed153641f9e06fa2d8ef31adb57a (diff) | |
download | Qt-c00ad8c6ba4b345b434aaedc7807e20b2fa64d3c.zip Qt-c00ad8c6ba4b345b434aaedc7807e20b2fa64d3c.tar.gz Qt-c00ad8c6ba4b345b434aaedc7807e20b2fa64d3c.tar.bz2 |
Fix leaks.
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/qml/qmlmetatype.cpp | 7 | ||||
-rw-r--r-- | src/declarative/qml/qmlmetatype.h | 1 | ||||
-rw-r--r-- | src/declarative/qml/qmlparser.cpp | 2 |
3 files changed, 10 insertions, 0 deletions
diff --git a/src/declarative/qml/qmlmetatype.cpp b/src/declarative/qml/qmlmetatype.cpp index c488c13..ac89d28 100644 --- a/src/declarative/qml/qmlmetatype.cpp +++ b/src/declarative/qml/qmlmetatype.cpp @@ -83,6 +83,7 @@ QT_BEGIN_NAMESPACE struct QmlMetaTypeData { + ~QmlMetaTypeData(); QList<QmlType *> types; typedef QHash<int, QmlType *> Ids; Ids idToType; @@ -101,6 +102,12 @@ struct QmlMetaTypeData Q_GLOBAL_STATIC(QmlMetaTypeData, metaTypeData) Q_GLOBAL_STATIC(QReadWriteLock, metaTypeDataLock) +QmlMetaTypeData::~QmlMetaTypeData() +{ + for (int i = 0; i < types.count(); ++i) + delete types.at(i); +} + class QmlTypePrivate { public: diff --git a/src/declarative/qml/qmlmetatype.h b/src/declarative/qml/qmlmetatype.h index 5ed9a5a..02c817d 100644 --- a/src/declarative/qml/qmlmetatype.h +++ b/src/declarative/qml/qmlmetatype.h @@ -151,6 +151,7 @@ public: private: friend class QmlMetaType; friend class QmlTypePrivate; + friend class QmlMetaTypeData; QmlType(int, int, int, QmlPrivate::Func, const char *, int); QmlType(int, int, int, QmlPrivate::Func, const char *, int, int, int, const QMetaObject *, QmlAttachedPropertiesFunc, const QMetaObject *, int, int, QmlPrivate::CreateFunc, const QMetaObject *, int, QmlCustomParser *); ~QmlType(); diff --git a/src/declarative/qml/qmlparser.cpp b/src/declarative/qml/qmlparser.cpp index 0f2a282..e102f05 100644 --- a/src/declarative/qml/qmlparser.cpp +++ b/src/declarative/qml/qmlparser.cpp @@ -80,6 +80,8 @@ QmlParser::Object::~Object() prop->release(); foreach(Property *prop, valueTypeProperties) prop->release(); + foreach(const DynamicProperty &prop, dynamicProperties) + if (prop.defaultValue) prop.defaultValue->release(); } const QMetaObject *Object::metaObject() const |