Finally fix memory leak

This commit is contained in:
Alex Spataru 2022-01-02 15:51:53 -05:00
parent 83b53b3d35
commit 696f04aea4
3 changed files with 5 additions and 8 deletions

View File

@ -158,11 +158,10 @@ FramelessWindow.CustomWindow {
target: Cpp_UI_Dashboard
function onUpdated() {
if (!root.firstValidFrame)
if (root.firstValidFrame)
return
if ((Cpp_IO_Manager.connected || Cpp_CSV_Player.isOpen) &&
Cpp_UI_Dashboard.frameValid()) {
if ((Cpp_IO_Manager.connected || Cpp_CSV_Player.isOpen) && Cpp_UI_Dashboard.frameValid()) {
setup.hide()
root.showDashboard()
root.firstValidFrame = true

View File

@ -261,9 +261,6 @@ void JSON::Generator::readData(const QByteArray &data)
// Create JSON document
m_json = QJsonDocument::fromJson(json.toUtf8(), &m_error).object();
// Clear strings
json.clear();
}
// No parse error, update UI & reset error counter

View File

@ -186,7 +186,7 @@ void Plugins::Server::acceptConnection()
// React to socket errors
// clang-format off
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)),
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)),
this, SLOT(onErrorOccurred(QAbstractSocket::SocketError)));
#else
connect(socket, &QTcpSocket::errorOccurred,
@ -291,7 +291,8 @@ void Plugins::Server::sendRawData(const QByteArray &data)
*/
void Plugins::Server::registerFrame(const QJsonObject &json)
{
m_frames.append(json);
if (enabled())
m_frames.append(json);
}
/**