1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 18:56:34 +01:00

NetworkManager: Remove NetworkUrlInterceptor in shutdown

Fixes potential crash on close
This commit is contained in:
David Rosca 2017-01-26 12:34:55 +01:00
parent 650bc03241
commit f7005f8d95
3 changed files with 11 additions and 4 deletions

View File

@ -748,6 +748,7 @@ void MainApplication::saveSettings()
m_searchEnginesManager->saveSettings(); m_searchEnginesManager->saveSettings();
m_plugins->shutdown(); m_plugins->shutdown();
m_networkManager->shutdown();
DataPaths::clearTempData(); DataPaths::clearTempData();

View File

@ -1,6 +1,6 @@
/* ============================================================ /* ============================================================
* QupZilla - WebKit based browser * QupZilla - Qt web browser
* Copyright (C) 2010-2016 David Rosca <nowrep@gmail.com> * Copyright (C) 2010-2017 David Rosca <nowrep@gmail.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -249,6 +249,11 @@ void NetworkManager::loadSettings()
m_urlInterceptor->loadSettings(); m_urlInterceptor->loadSettings();
} }
void NetworkManager::shutdown()
{
mApp->webProfile()->setRequestInterceptor(nullptr);
}
QNetworkReply *NetworkManager::createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice *outgoingData) QNetworkReply *NetworkManager::createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice *outgoingData)
{ {
QNetworkRequest req = request; QNetworkRequest req = request;

View File

@ -1,6 +1,6 @@
/* ============================================================ /* ============================================================
* QupZilla - WebKit based browser * QupZilla - Qt web browser
* Copyright (C) 2010-2016 David Rosca <nowrep@gmail.com> * Copyright (C) 2010-2017 David Rosca <nowrep@gmail.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -41,6 +41,7 @@ public:
void removeUrlInterceptor(UrlInterceptor *interceptor); void removeUrlInterceptor(UrlInterceptor *interceptor);
void loadSettings(); void loadSettings();
void shutdown();
protected: protected:
QNetworkReply *createRequest(Operation op, const QNetworkRequest &request, QIODevice *outgoingData) Q_DECL_OVERRIDE; QNetworkReply *createRequest(Operation op, const QNetworkRequest &request, QIODevice *outgoingData) Q_DECL_OVERRIDE;