MCPcopy Create free account
hub / github.com/Windscribe/Desktop-App / cleanupImpl

Method cleanupImpl

src/client/engine/engine/engine.cpp:842–951  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

840}
841
842void Engine::cleanupImpl(bool isUpdating)
843{
844 // Ensure this slot only gets invoked once.
845 disconnect(this, &Engine::initCleanup, nullptr, nullptr);
846
847 if (isCleanupFinished_) {
848 qCCritical(LOG_BASIC) << "WARNING - Engine::cleanupImpl called repeatedly. Verify code logic as this should not happen.";
849 return;
850 }
851
852 qCDebug(LOG_BASIC) << "Cleanup started";
853
854 isCleanup_ = true;
855 saveWsnetSettings();
856 // stop all network requests here, because we won't have callback's called for deleted objects
857 WSNet::cleanup();
858
859#ifdef Q_OS_MACOS
860 if (macSpoofTimer_) {
861 macSpoofTimer_->stop();
862 }
863#endif
864
865 if (emergencyController_) {
866 emergencyController_->blockingDisconnect();
867 }
868
869 if (connectionManager_) {
870 bool bWasIsConnected = !connectionManager_->isDisconnected();
871 connectionManager_->blockingDisconnect(false);
872 if (bWasIsConnected) {
873#ifdef Q_OS_WIN
874 enableDohSettings();
875#endif
876 qCInfo(LOG_BASIC) << "Cleanup, connection manager disconnected";
877 } else {
878 qCInfo(LOG_BASIC) << "Cleanup, connection manager no need disconnect";
879 }
880
881 connectionManager_->removeIkev2ConnectionFromOS();
882 }
883
884 // turn off split tunneling
885 if (helper_) {
886 helper_->sendConnectStatus(false, engineSettings_.isTerminateSockets(), engineSettings_.isAllowLanTraffic(), AdapterGatewayInfo::detectAndCreateDefaultAdapterInfo(), AdapterGatewayInfo(), QString(), types::Protocol());
887 helper_->setSplitTunnelingSettings(false, false, false, QStringList(), QStringList(), QStringList());
888 }
889
890#ifdef Q_OS_WIN
891 helper_->removeAppNetworkProfiles();
892#endif
893
894 if (vpnShareController_) {
895 vpnShareController_->stopWifiSharing();
896 vpnShareController_->userStopProxySharing();
897 }
898
899 if (helper_ && firewallController_) {

Callers

nothing calls this directly

Calls 15

enableDohSettingsFunction · 0.85
ProtocolClass · 0.85
userStopProxySharingMethod · 0.80
isAlwaysOnModeMethod · 0.80
AdapterGatewayInfoClass · 0.50
stopMethod · 0.45
blockingDisconnectMethod · 0.45
isDisconnectedMethod · 0.45

Tested by

no test coverage detected