summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/StreamStack/ConnectionLayer.h')
-rw-r--r--Swiften/StreamStack/ConnectionLayer.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/Swiften/StreamStack/ConnectionLayer.h b/Swiften/StreamStack/ConnectionLayer.h
index fab014e..0da0900 100644
--- a/Swiften/StreamStack/ConnectionLayer.h
+++ b/Swiften/StreamStack/ConnectionLayer.h
@@ -20,6 +20,10 @@ namespace Swift {
connection->onDataRead.connect(boost::bind(&ConnectionLayer::writeDataToParentLayer, this, _1));
}
+ ~ConnectionLayer() {
+ connection->onDataRead.disconnect(boost::bind(&ConnectionLayer::writeDataToParentLayer, this, _1));
+ }
+
void writeData(const ByteArray& data) {
connection->write(data);
}