1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

Fix leaking QWebEngineUrlRequestJob reply

BUG: 403129
FIXED-IN: 3.1.0
This commit is contained in:
David Rosca 2019-01-23 17:05:55 +01:00
parent 1c4a8ddd6f
commit 0389da311c
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8
3 changed files with 3 additions and 2 deletions

View File

@ -24,7 +24,7 @@
// ExtensionSchemeHandler
void ExtensionSchemeHandler::setReply(QWebEngineUrlRequestJob *job, const QByteArray &contentType, const QByteArray &content)
{
QBuffer *buffer = new QBuffer();
QBuffer *buffer = new QBuffer(job);
buffer->open(QIODevice::ReadWrite);
buffer->write(content);
buffer->seek(0);

View File

@ -55,7 +55,7 @@ void FalkonSchemeHandler::requestStarted(QWebEngineUrlRequestJob *job)
knownPages << "about" << "start" << "speeddial" << "config" << "restore";
if (knownPages.contains(job->requestUrl().path()))
job->reply(QByteArrayLiteral("text/html"), new FalkonSchemeReply(job));
job->reply(QByteArrayLiteral("text/html"), new FalkonSchemeReply(job, job));
else
job->fail(QWebEngineUrlRequestJob::UrlInvalid);
}

View File

@ -57,6 +57,7 @@ void KIOSchemeHandler::requestStarted(QWebEngineUrlRequestJob *job)
qWarning() << "Error:" << reply->errorString();
job->fail(QWebEngineUrlRequestJob::RequestFailed);
} else {
reply->setParent(job);
job->reply(reply->header(QNetworkRequest::ContentTypeHeader).toByteArray(), reply);
}
});