mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
Always disconnect CNetworkVatlib when shutting down.
This commit is contained in:
@@ -216,16 +216,12 @@ namespace BlackCore
|
||||
CStatusMessage CContextNetwork::disconnectFromNetwork()
|
||||
{
|
||||
if (this->isDebugEnabled()) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (this->m_network->isConnected())
|
||||
if (this->m_network->isConnected() || this->m_network->isPendingConnection())
|
||||
{
|
||||
this->m_currentStatus = INetwork::Disconnecting; // as semaphore we are going to disconnect
|
||||
this->m_network->terminateConnection();
|
||||
return CStatusMessage({ CLogCategory::validation() }, CStatusMessage::SeverityInfo, "Connection terminating");
|
||||
}
|
||||
else if (this->isPendingConnection())
|
||||
{
|
||||
return CStatusMessage({ CLogCategory::validation() }, CStatusMessage::SeverityInfo, "Pending connection, please wait");
|
||||
}
|
||||
else
|
||||
{
|
||||
return CStatusMessage({ CLogCategory::validation() }, CStatusMessage::SeverityWarning, "Already disconnected");
|
||||
|
||||
Reference in New Issue
Block a user