Commit 69a1cd3f authored by Thomas BOUTROUE's avatar Thomas BOUTROUE

Clear QML cache on reset even when no network is active

(could remain error data in cache)
parent fd2ef301
......@@ -250,10 +250,10 @@ void Manager::reset (void) {
void Manager::deinit (void) {
static QElapsedTimer bench;
bench.restart ();
update_ready (false);
update_hasValidNetwork (false);
if (m_currentNetwork) {
NetworkDefinition * oldNet = m_currentNetwork;
update_ready (false);
update_hasValidNetwork (false);
update_currentNetwork (Q_NULLPTR);
QCoreApplication::processEvents ();
m_objectsInstances.clear ();
......@@ -310,10 +310,10 @@ void Manager::deinit (void) {
m_serialBuses.clear ();
m_dashboards.clear ();
delete oldNet;
qmlEngine->collectGarbage ();
qmlEngine->trimComponentCache ();
QCoreApplication::processEvents ();
}
qmlEngine->collectGarbage ();
qmlEngine->trimComponentCache ();
QCoreApplication::processEvents ();
WARN << "Network reset in" << bench.elapsed () << "ms";
}
......
......@@ -2,8 +2,8 @@ import QtQml 2.2;
import QtCAN.CanTestBench 2.0;
NetworkDefinition {
uid: "TEST";
title: "Test network definition 1 (robotic arm)";
uid: "TEST NG";
title: "Test network definition NG (robotic arm)";
dumpObjectsOnInit: false;
benchmarkSimulatorTick: false;
benchmarkCanFramesTiming: false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment