From: APTX Date: Wed, 1 Mar 2017 15:01:12 +0000 (+0100) Subject: Don't delete TimeFormatter immediately X-Git-Url: https://gitweb.aptx.org/?a=commitdiff_plain;h=0aacf85460f0fe026dcd1a3ed6d95e59e4cb1800;p=aniplayer.git Don't delete TimeFormatter immediately It will is deleted implicitly as a child of InstanceManager. --- diff --git a/core/instancemanager.cpp b/core/instancemanager.cpp index fca0c20..43eb236 100644 --- a/core/instancemanager.cpp +++ b/core/instancemanager.cpp @@ -43,9 +43,9 @@ void InstanceManager::startFirstInstance() { qCDebug(imCategory) << "Parsed positional argument as" << url; player->setNextSource(url); } - TimeFormatter timeFormatter; + auto timeFormatter = new TimeFormatter{this}; engine->rootContext()->setContextProperty("player", player); - engine->rootContext()->setContextProperty("timeFormatter", &timeFormatter); + engine->rootContext()->setContextProperty("timeFormatter", timeFormatter); qCDebug(imCategory, "Player Added"); engine->load(QUrl(QStringLiteral("qrc:/qml/main.qml"))); qCDebug(imCategory, "QML engine loaded");