summaryrefslogtreecommitdiffstats
path: root/network/network.cpp
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2018-09-12 10:56:00 -0700
committerMatt Ranostay <matt.ranostay@konsulko.com>2018-09-12 19:06:08 +0000
commitfc112fb9066e26e5481b3a434ac9be614f97367a (patch)
tree0e3a2e26d244a7decba586e68bb154e68298f1d6 /network/network.cpp
parentcc65b62a4625188c8aab3406dd50d71c16722a3a (diff)
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 <matt.ranostay@konsulko.com> (cherry picked from commit 051bf8e79c99699704032b7b943459a30aae22c8)
Diffstat (limited to 'network/network.cpp')
-rw-r--r--network/network.cpp20
1 files changed, 10 insertions, 10 deletions
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();