aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlapplicationengine.cpp
diff options
context:
space:
mode:
authorAlan Alpert <aalpert@blackberry.com>2013-07-30 15:27:31 -0700
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-31 08:37:02 +0200
commit2e4993fe61a2cbd01549c953701a9ac551c3d992 (patch)
treecf0f22088a0d2c939dcdb3b15ab627520c6a92f4 /src/qml/qml/qqmlapplicationengine.cpp
parent563d76066271477de0812213d475d3b769d9cfa1 (diff)
Clean up objects in QQmlApplicationEngine earlier
Deleting the objects in the private class destructor leads to crashes in V8 because the JS engine is in the middle of being deleted. Instead, delete the objects in the public class destructor so that it occurs before the actual engine cleanup starts to happen. Change-Id: I6bac813ce188be54842a78d7b532fcf2d54dc444 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlapplicationengine.cpp')
-rw-r--r--src/qml/qml/qqmlapplicationengine.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlapplicationengine.cpp b/src/qml/qml/qqmlapplicationengine.cpp
index 9181dad519..85aeaf5786 100644
--- a/src/qml/qml/qqmlapplicationengine.cpp
+++ b/src/qml/qml/qqmlapplicationengine.cpp
@@ -54,6 +54,10 @@ QQmlApplicationEnginePrivate::QQmlApplicationEnginePrivate(QQmlEngine *e)
QQmlApplicationEnginePrivate::~QQmlApplicationEnginePrivate()
{
+}
+
+void QQmlApplicationEnginePrivate::cleanUp()
+{
qDeleteAll(objects);
#ifndef QT_NO_TRANSLATIONS
qDeleteAll(translators);
@@ -229,7 +233,8 @@ QQmlApplicationEngine::QQmlApplicationEngine(const QString &filePath, QObject *p
*/
QQmlApplicationEngine::~QQmlApplicationEngine()
{
- //Instantiated root objects cleaned up in private class
+ Q_D(QQmlApplicationEngine);
+ d->cleanUp();//Instantiated root objects must be deleted before the engine
}
/*!