diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-12-27 15:10:27 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-12-27 15:24:23 (GMT) |
commit | 2ef4bb560dad95555a5ae94d0bd5bff49d50d3d3 (patch) | |
tree | 79a7eceecc4afe8785323983a1e4496dd52d7dd8 /Swiften/StreamStack | |
parent | cd9c5b8d87aaae48a058ae8d498bc81d0fed82ad (diff) | |
download | swift-contrib-2ef4bb560dad95555a5ae94d0bd5bff49d50d3d3.zip swift-contrib-2ef4bb560dad95555a5ae94d0bd5bff49d50d3d3.tar.bz2 |
Avoid leaking connection on exit.
Diffstat (limited to 'Swiften/StreamStack')
-rw-r--r-- | Swiften/StreamStack/ConnectionLayer.h | 4 |
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); } |