transport: Fix segfault when transport is closed while multiple send operations are scheduled
Change-Id: Icf6158150c9b6c2c17a89c01fc883eaf003e356e
Refs: #3136
diff --git a/src/transport/stream-transport.hpp b/src/transport/stream-transport.hpp
index 99dc510..5ec91b0 100644
--- a/src/transport/stream-transport.hpp
+++ b/src/transport/stream-transport.hpp
@@ -195,6 +195,10 @@
BOOST_THROW_EXCEPTION(Transport::Error(error, "error while sending data to socket"));
}
+ if (!m_transport.m_isConnected) {
+ return; // queue has been already cleared
+ }
+
m_transmissionQueue.erase(queueItem);
if (!m_transmissionQueue.empty()) {