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>
QQmlApplicationEnginePrivate::~QQmlApplicationEnginePrivate()
{
+}
+
+void QQmlApplicationEnginePrivate::cleanUp()
+{
qDeleteAll(objects);
#ifndef QT_NO_TRANSLATIONS
qDeleteAll(translators);
*/
QQmlApplicationEngine::~QQmlApplicationEngine()
{
- //Instantiated root objects cleaned up in private class
+ Q_D(QQmlApplicationEngine);
+ d->cleanUp();//Instantiated root objects must be deleted before the engine
}
/*!
QQmlApplicationEnginePrivate(QQmlEngine *e);
~QQmlApplicationEnginePrivate();
void init();
+ void cleanUp();
void startLoad(const QUrl &url, const QByteArray &data = QByteArray(), bool dataFlag = false);
void loadTranslations(const QUrl &rootFile);