Destructor crash fix

This commit is contained in:
pokamest 2021-12-20 15:43:36 +03:00
parent 5776ca0384
commit 5ae9873455
2 changed files with 6 additions and 6 deletions

View file

@ -123,9 +123,9 @@ UiLogic::~UiLogic()
}
}
m_vpnConnection->deleteLater();
m_vpnConnectionThread.quit();
m_vpnConnectionThread.wait(3000);
delete m_vpnConnection;
qDebug() << "Application closed";
}

View file

@ -26,16 +26,16 @@
#include "utils.h"
#include "vpnconnection.h"
VpnConnection::VpnConnection(QObject* parent) : QObject(parent)
{
VpnConnection::VpnConnection(QObject* parent) : QObject(parent),
m_settings(this)
{
}
VpnConnection::~VpnConnection()
{
//qDebug() << "VpnConnection::~VpnConnection() 1";
m_vpnProtocol->deleteLater();
m_vpnProtocol.clear();
//qDebug() << "VpnConnection::~VpnConnection() 2";
}
void VpnConnection::onBytesChanged(quint64 receivedBytes, quint64 sentBytes)
@ -220,7 +220,7 @@ void VpnConnection::connectToVpn(int serverIndex,
#if !defined (Q_OS_ANDROID) && !defined (Q_OS_IOS)
if (!m_IpcClient) {
m_IpcClient = new IpcClient;
m_IpcClient = new IpcClient(this);
}
if (!m_IpcClient->isSocketConnected()) {