diff options
author | Christian Kamm <[email protected]> | 2011-01-04 17:04:44 +0100 |
---|---|---|
committer | Christian Kamm <[email protected]> | 2011-01-06 15:01:09 +0100 |
commit | ab642bc8206b291fb8b6f8a569ae4902a935187c (patch) | |
tree | e1439f85b5dce1424560f9ee14e8c971af9221ae /src/plugins/qmljstools/qmljsplugindumper.cpp | |
parent | 62d66fcd1542ebed3259606c792472c035960ebc (diff) |
QmlJS: Add refcounting to FakeMetaObjects.
Previously they were leaked when a qmldump or the C++ exported QML
type list updated.
Just deleting the previous FakeMetaObjects is not an option, as they
might still be used in a QmlObjectValue owned by an Engine.
Reviewed-by: Erik Verbruggen
Diffstat (limited to 'src/plugins/qmljstools/qmljsplugindumper.cpp')
-rw-r--r-- | src/plugins/qmljstools/qmljsplugindumper.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/qmljstools/qmljsplugindumper.cpp b/src/plugins/qmljstools/qmljsplugindumper.cpp index 56f98333815..cc05c9a2783 100644 --- a/src/plugins/qmljstools/qmljsplugindumper.cpp +++ b/src/plugins/qmljstools/qmljsplugindumper.cpp @@ -126,15 +126,15 @@ static QString qmldumpFailedMessage() return PluginDumper::tr("Type dump of C++ plugin failed.\nCheck 'General Messages' output pane for details."); } -static QList<const FakeMetaObject *> parseHelper(const QByteArray &xml, QString *error) +static QList<FakeMetaObject::ConstPtr> parseHelper(const QByteArray &xml, QString *error) { - QList<const FakeMetaObject *> ret; - QMap<QString, FakeMetaObject *> newObjects; + QList<FakeMetaObject::ConstPtr> ret; + QMap<QString, FakeMetaObject::Ptr> newObjects; *error = Interpreter::CppQmlTypesLoader::parseQmlTypeXml(xml, &newObjects); if (error->isEmpty()) { // convert from QList<T *> to QList<const T *> - QMapIterator<QString, FakeMetaObject *> it(newObjects); + QMapIterator<QString, FakeMetaObject::Ptr> it(newObjects); while (it.hasNext()) { it.next(); ret.append(it.value()); @@ -162,7 +162,7 @@ void PluginDumper::qmlPluginTypeDumpDone(int exitCode) const QByteArray output = process->readAllStandardOutput(); QString error; - QList<const FakeMetaObject *> objectsList = parseHelper(output, &error); + QList<FakeMetaObject::ConstPtr> objectsList = parseHelper(output, &error); if (exitCode == 0 && !error.isEmpty()) { libraryInfo.setDumpStatus(LibraryInfo::DumpError, tr("Type dump of C++ plugin failed. Parse error:\n'%1'").arg(error)); } @@ -229,7 +229,7 @@ void PluginDumper::dump(const Plugin &plugin) libraryXmlFile.close(); QString error; - const QList<const FakeMetaObject *> objectsList = parseHelper(xml, &error); + const QList<FakeMetaObject::ConstPtr> objectsList = parseHelper(xml, &error); if (error.isEmpty()) { libraryInfo.setMetaObjects(objectsList); |