From 051bf8e79c99699704032b7b943459a30aae22c8 Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Wed, 12 Sep 2018 10:56:00 -0700 Subject: libqtappfw: remove deleteLater instances that aren't used Remove several deleteLater calls that should have been delete's. This should solve race conditions that an object calls deleteLater(), and leaves scope before the QT main loop is called. Outcome of the race condition is that sometimes the memory allocator reallocates it to another message and causes a crash. Bug-AGL: SPEC-1680 Change-Id: Ic83d8c6c204c6e3248bbe9a9def1842e1e384b2b Signed-off-by: Matt Ranostay --- network/network.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'network') diff --git a/network/network.cpp b/network/network.cpp index 7bcf6d0..db4b2b4 100644 --- a/network/network.cpp +++ b/network/network.cpp @@ -60,7 +60,7 @@ void Network::connect(QString service) nmsg->createRequest("connect_service", parameter); m_mloop->sendMessage(nmsg); - nmsg->deleteLater(); + delete nmsg; } void Network::disconnect(QString service) @@ -72,7 +72,7 @@ void Network::disconnect(QString service) nmsg->createRequest("disconnect_service", parameter); m_mloop->sendMessage(nmsg); - nmsg->deleteLater(); + delete nmsg; } void Network::input(int id, QString passphrase) @@ -86,7 +86,7 @@ void Network::input(int id, QString passphrase) nmsg->createRequest("agent_response", parameter); m_mloop->sendMessage(nmsg); - nmsg->deleteLater(); + delete nmsg; } void Network::power(bool on) @@ -106,7 +106,7 @@ void Network::enableTechnology(QString type) nmsg->createRequest("enable_technology", parameter); m_mloop->sendMessage(nmsg); - nmsg->deleteLater(); + delete nmsg; } void Network::disableTechnology(QString type) @@ -118,7 +118,7 @@ void Network::disableTechnology(QString type) nmsg->createRequest("disable_technology", parameter); m_mloop->sendMessage(nmsg); - nmsg->deleteLater(); + delete nmsg; } void Network::scanServices(QString type) @@ -130,7 +130,7 @@ void Network::scanServices(QString type) nmsg->createRequest("scan_services", parameter); m_mloop->sendMessage(nmsg); - nmsg->deleteLater(); + delete nmsg; } bool Network::addService(QJsonObject service) @@ -189,7 +189,7 @@ void Network::getServices() nmsg->createRequest("services", parameter); m_mloop->sendMessage(nmsg); - nmsg->deleteLater(); + delete nmsg; } void Network::updateWifiStatus(QJsonObject properties) @@ -235,7 +235,7 @@ void Network::getTechnologies() nmsg->createRequest("technologies", parameter); m_mloop->sendMessage(nmsg); - nmsg->deleteLater(); + delete nmsg; } void Network::updateServiceProperties(QJsonObject data) @@ -311,7 +311,7 @@ void Network::onConnected() parameter.insert("value", eventIterator.next()); nmsg->createRequest("subscribe", parameter); m_mloop->sendMessage(nmsg); - nmsg->deleteLater(); + delete nmsg; } getTechnologies(); @@ -328,7 +328,7 @@ void Network::onDisconnected() parameter.insert("value", eventIterator.next()); nmsg->createRequest("unsubscribe", parameter); m_mloop->sendMessage(nmsg); - nmsg->deleteLater(); + delete nmsg; } m_wifi->removeAllNetworks(); -- cgit 1.2.3-korg