mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
add a safeguard deleteLater for QNetworkReply
This commit is contained in:
parent
24f92502b5
commit
70cab27c1a
1 changed files with 9 additions and 1 deletions
|
@ -390,11 +390,19 @@ void AccountManager::sendRequest(const QString& path,
|
|||
|
||||
// double check if the finished network reply had a session ID in the header and make
|
||||
// sure that our session ID matches that value if so
|
||||
connect(networkReply, &QNetworkReply::finished, this, [this, networkReply]{
|
||||
connect(networkReply, &QNetworkReply::finished, this, [this, callbackParams, networkReply]{
|
||||
if (networkReply->error() == QNetworkReply::NoError) {
|
||||
if (networkReply->hasRawHeader(METAVERSE_SESSION_ID_HEADER)) {
|
||||
_sessionID = networkReply->rawHeader(METAVERSE_SESSION_ID_HEADER);
|
||||
}
|
||||
|
||||
if (!callbackParams.jsonCallbackReceiver) {
|
||||
networkReply->deleteLater();
|
||||
}
|
||||
} else {
|
||||
if (!callbackParams.errorCallbackReceiver) {
|
||||
networkReply->deleteLater();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue