diff --git a/src/ui/fortmanager.cpp b/src/ui/fortmanager.cpp index 83e07fc4..5e3747be 100644 --- a/src/ui/fortmanager.cpp +++ b/src/ui/fortmanager.cpp @@ -135,7 +135,7 @@ FortManager::FortManager(QObject *parent) : QObject(parent) { } FortManager::~FortManager() { if (m_initialized) { - closeDriver(); + closeOrRemoveDriver(); } deleteManagers(); @@ -334,6 +334,20 @@ void FortManager::closeDriver() QCoreApplication::sendPostedEvents(this); } +void FortManager::closeOrRemoveDriver() +{ + if (canInstallDriver() && !IoC()->hasService()) { + const FirewallConf *conf = IoC()->conf(); + + if (!conf->bootFilter()) { + removeDriver(); + return; + } + } + + closeDriver(); +} + bool FortManager::canInstallDriver() const { const auto settings = IoC(); diff --git a/src/ui/fortmanager.h b/src/ui/fortmanager.h index 047cb9ff..5ad3fb2f 100644 --- a/src/ui/fortmanager.h +++ b/src/ui/fortmanager.h @@ -44,7 +44,10 @@ private: bool setupDriver(); void closeDriver(); + void closeOrRemoveDriver(); + bool canInstallDriver() const; + void checkReinstallDriver(); void checkDriverOpened(); void checkStartService();