summaryrefslogtreecommitdiffstats
path: root/qdb/server/connection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qdb/server/connection.cpp')
-rw-r--r--qdb/server/connection.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/qdb/server/connection.cpp b/qdb/server/connection.cpp
index 03f2693..2b13666 100644
--- a/qdb/server/connection.cpp
+++ b/qdb/server/connection.cpp
@@ -116,7 +116,8 @@ void Connection::handleMessage()
if (message.command() == QdbMessage::Invalid) {
qCCritical(connectionC) << "Connection received invalid message!";
- resetConnection(false);
+ if (m_state != ConnectionState::Disconnected)
+ resetConnection(false);
return;
}
@@ -276,6 +277,10 @@ void Connection::resetConnection(bool reconnect)
m_outgoingMessages.clear();
m_state = ConnectionState::Disconnected;
m_streamRequests.clear();
+ for (const auto &pair : m_streams) {
+ const auto &stream = pair.second;
+ stream->close();
+ }
m_streams.clear();
if (reconnect)