From 6f392ce12632b0c0f18d92be2202cb12b41e1f30 Mon Sep 17 00:00:00 2001 From: pokamest Date: Wed, 4 Oct 2023 16:09:03 +0100 Subject: [PATCH] Crash on exit fix for Windows --- client/protocols/wireguardprotocol.cpp | 2 -- client/ui/controllers/connectionController.cpp | 17 ----------------- client/ui/controllers/connectionController.h | 2 +- 3 files changed, 1 insertion(+), 20 deletions(-) diff --git a/client/protocols/wireguardprotocol.cpp b/client/protocols/wireguardprotocol.cpp index a4005efbe..d675cd02e 100644 --- a/client/protocols/wireguardprotocol.cpp +++ b/client/protocols/wireguardprotocol.cpp @@ -101,8 +101,6 @@ void WireguardProtocol::stop() #if defined(Q_OS_MAC) || defined(Q_OS_WIN) || defined(Q_OS_LINUX) ErrorCode WireguardProtocol::startMzImpl() { - - qDebug() << "WireguardProtocol::startMzImpl():" << m_rawConfig; m_impl->activate(m_rawConfig); return ErrorCode::NoError; } diff --git a/client/ui/controllers/connectionController.cpp b/client/ui/controllers/connectionController.cpp index 77ca0f5f9..9b4ae6d46 100644 --- a/client/ui/controllers/connectionController.cpp +++ b/client/ui/controllers/connectionController.cpp @@ -21,23 +21,6 @@ ConnectionController::ConnectionController(const QSharedPointer &s Qt::QueuedConnection); } -ConnectionController::~ConnectionController() -{ -// todo use ConnectionController instead of using m_vpnConnection directly -#ifdef AMNEZIA_DESKTOP - if (m_vpnConnection->connectionState() != Vpn::ConnectionState::Disconnected) { - m_vpnConnection->disconnectFromVpn(); - for (int i = 0; i < 50; i++) { - qApp->processEvents(QEventLoop::ExcludeUserInputEvents); - QThread::msleep(100); - if (m_vpnConnection->isDisconnected()) { - break; - } - } - } -#endif -} - void ConnectionController::openConnection() { int serverIndex = m_serversModel->getDefaultServerIndex(); diff --git a/client/ui/controllers/connectionController.h b/client/ui/controllers/connectionController.h index 7bfe0faca..e09cdcdf2 100644 --- a/client/ui/controllers/connectionController.h +++ b/client/ui/controllers/connectionController.h @@ -19,7 +19,7 @@ public: const QSharedPointer &containersModel, const QSharedPointer &vpnConnection, QObject *parent = nullptr); - ~ConnectionController(); + ~ConnectionController() = default; bool isConnected() const; bool isConnectionInProgress() const;