Skip to content

Commit

Permalink
Crash on exit fix for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
pokamest committed Oct 4, 2023
1 parent 70e6a3d commit 6f392ce
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 20 deletions.
2 changes: 0 additions & 2 deletions client/protocols/wireguardprotocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
17 changes: 0 additions & 17 deletions client/ui/controllers/connectionController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,6 @@ ConnectionController::ConnectionController(const QSharedPointer<ServersModel> &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();
Expand Down
2 changes: 1 addition & 1 deletion client/ui/controllers/connectionController.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ConnectionController : public QObject
const QSharedPointer<ContainersModel> &containersModel,
const QSharedPointer<VpnConnection> &vpnConnection, QObject *parent = nullptr);

~ConnectionController();
~ConnectionController() = default;

bool isConnected() const;
bool isConnectionInProgress() const;
Expand Down

0 comments on commit 6f392ce

Please sign in to comment.