diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/net/pop3/POP3Connection.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/net/pop3/POP3Connection.cpp b/src/net/pop3/POP3Connection.cpp index 33349749..948242d7 100644 --- a/src/net/pop3/POP3Connection.cpp +++ b/src/net/pop3/POP3Connection.cpp @@ -188,18 +188,25 @@ void POP3Connection::disconnect() void POP3Connection::internalDisconnect() { - try - { - POP3Command::QUIT()->send(thisRef().dynamicCast <POP3Connection>()); - POP3Response::readResponse(thisRef().dynamicCast <POP3Connection>()); - } - catch (exception&) + if (m_socket) { - // Not important - } + if (m_socket->isConnected()) + { + try + { + POP3Command::QUIT()->send(thisRef().dynamicCast <POP3Connection>()); + POP3Response::readResponse(thisRef().dynamicCast <POP3Connection>()); + } + catch (exception&) + { + // Not important + } - m_socket->disconnect(); - m_socket = NULL; + m_socket->disconnect(); + } + + m_socket = NULL; + } m_timeoutHandler = NULL; |