From fa2cd481324d65d754d77f4fb3a99cc394fdba78 Mon Sep 17 00:00:00 2001
From: Michael Brasser <michael.brasser@nokia.com>
Date: Tue, 8 Sep 2009 11:10:47 +1000
Subject: Fix leaks.

---
 src/declarative/fx/qfxpathview.cpp              | 3 +++
 src/declarative/qml/qmlcompositetypemanager.cpp | 1 +
 src/declarative/qml/qmlmetatype.cpp             | 1 +
 src/declarative/util/qfxview.cpp                | 2 +-
 4 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/declarative/fx/qfxpathview.cpp b/src/declarative/fx/qfxpathview.cpp
index 469e9f3..62f9db0 100644
--- a/src/declarative/fx/qfxpathview.cpp
+++ b/src/declarative/fx/qfxpathview.cpp
@@ -128,6 +128,9 @@ QFxPathView::QFxPathView(QFxPathViewPrivate &dd, QFxItem *parent)
 
 QFxPathView::~QFxPathView()
 {
+    Q_D(QFxPathView);
+    if (d->ownModel)
+        delete d->model;
 }
 
 /*!
diff --git a/src/declarative/qml/qmlcompositetypemanager.cpp b/src/declarative/qml/qmlcompositetypemanager.cpp
index bcfbcc8..a99cff0 100644
--- a/src/declarative/qml/qmlcompositetypemanager.cpp
+++ b/src/declarative/qml/qmlcompositetypemanager.cpp
@@ -87,6 +87,7 @@ QmlComponent *QmlCompositeTypeData::toComponent(QmlEngine *engine)
         QmlCompiledData *cc = toCompiledComponent(engine);
         if (cc) {
             component = new QmlComponent(engine, cc, -1, -1, 0);
+            cc->release();
         } else {
             component = new QmlComponent(engine, 0);
             component->d_func()->url = imports.baseUrl();
diff --git a/src/declarative/qml/qmlmetatype.cpp b/src/declarative/qml/qmlmetatype.cpp
index ac89d28..14d85ff 100644
--- a/src/declarative/qml/qmlmetatype.cpp
+++ b/src/declarative/qml/qmlmetatype.cpp
@@ -197,6 +197,7 @@ QmlType::QmlType(int type, int listType, int qmlListType,
 
 QmlType::~QmlType()
 {
+    delete d->m_customParser;
     delete d;
 }
 
diff --git a/src/declarative/util/qfxview.cpp b/src/declarative/util/qfxview.cpp
index 9291e1a..2a38cda 100644
--- a/src/declarative/util/qfxview.cpp
+++ b/src/declarative/util/qfxview.cpp
@@ -222,7 +222,7 @@ void QFxView::execute()
     if (d->qml.isEmpty()) {
         d->component = new QmlComponent(&d->engine, d->source, this);
     } else {
-        d->component = new QmlComponent(&d->engine, d->qml.toUtf8(), d->source);
+        d->component = new QmlComponent(&d->engine, d->qml.toUtf8(), d->source, this);
     }
 
     if (!d->component->isLoading()) {
-- 
cgit v0.12