mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
Fix leaking QWebEngineUrlRequestJob reply
BUG: 403129 FIXED-IN: 3.1.0
This commit is contained in:
parent
1c4a8ddd6f
commit
0389da311c
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user