Fix memory leaks

This commit is contained in:
Gary Talent 2021-07-28 01:55:14 -05:00
parent 79982c5c2c
commit 3b470d5346
2 changed files with 6 additions and 1 deletions

View File

@ -40,7 +40,7 @@ void OBSClient::setSlidesVisible(int state) {
void OBSClient::get(QString urlExt) { void OBSClient::get(QString urlExt) {
QUrl url(QString(BaseUrl) + urlExt); QUrl url(QString(BaseUrl) + urlExt);
QNetworkRequest rqst(url); QNetworkRequest rqst(url);
m_nam->get(rqst); m_nam->get(rqst)->deleteLater();
} }
void OBSClient::poll() { void OBSClient::poll() {
@ -50,6 +50,7 @@ void OBSClient::poll() {
} }
void OBSClient::handlePollResponse(QNetworkReply *reply) { void OBSClient::handlePollResponse(QNetworkReply *reply) {
reply->deleteLater();
if (reply->error()) { if (reply->error()) {
qDebug() << "OBSClient error response:" << reply->errorString(); qDebug() << "OBSClient error response:" << reply->errorString();
emit pollFailed(); emit pollFailed();

View File

@ -85,12 +85,14 @@ void OpenLPClient::poll() {
} }
void OpenLPClient::handleGeneralResponse(QNetworkReply *reply) { void OpenLPClient::handleGeneralResponse(QNetworkReply *reply) {
reply->deleteLater();
if (reply->error()) { if (reply->error()) {
qDebug() << "OpenLPClient error response:" << reply->request().url() << ":" << reply->errorString(); qDebug() << "OpenLPClient error response:" << reply->request().url() << ":" << reply->errorString();
} }
} }
void OpenLPClient::handlePollResponse(QNetworkReply *reply) { void OpenLPClient::handlePollResponse(QNetworkReply *reply) {
reply->deleteLater();
if (reply->error()) { if (reply->error()) {
qDebug() << "OpenLPClient error response:" << reply->errorString(); qDebug() << "OpenLPClient error response:" << reply->errorString();
emit pollFailed(); emit pollFailed();
@ -120,6 +122,7 @@ void OpenLPClient::handlePollResponse(QNetworkReply *reply) {
} }
void OpenLPClient::handleSongListResponse(QNetworkReply *reply) { void OpenLPClient::handleSongListResponse(QNetworkReply *reply) {
reply->deleteLater();
if (reply->error()) { if (reply->error()) {
qDebug() << "OpenLPClient error response:" << reply->errorString(); qDebug() << "OpenLPClient error response:" << reply->errorString();
} }
@ -142,6 +145,7 @@ void OpenLPClient::handleSongListResponse(QNetworkReply *reply) {
} }
void OpenLPClient::handleSlideListResponse(QNetworkReply *reply) { void OpenLPClient::handleSlideListResponse(QNetworkReply *reply) {
reply->deleteLater();
if (reply->error()) { if (reply->error()) {
qDebug() << "OpenLPClient error response:" << reply->errorString(); qDebug() << "OpenLPClient error response:" << reply->errorString();
} }