diff options
Diffstat (limited to 'Swiften/StreamStack/WhitespacePingLayer.cpp')
-rw-r--r-- | Swiften/StreamStack/WhitespacePingLayer.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Swiften/StreamStack/WhitespacePingLayer.cpp b/Swiften/StreamStack/WhitespacePingLayer.cpp index b9fbbd1..b10ba1a 100644 --- a/Swiften/StreamStack/WhitespacePingLayer.cpp +++ b/Swiften/StreamStack/WhitespacePingLayer.cpp @@ -6,13 +6,9 @@ namespace Swift { static const int TIMEOUT_MILLISECONDS = 60000; WhitespacePingLayer::WhitespacePingLayer() { - timer_ = new Timer(TIMEOUT_MILLISECONDS); - timer_->onTick.connect(boost::bind(&WhitespacePingLayer::handleTimerTick, this)); - timer_->start(); -} - -WhitespacePingLayer::~WhitespacePingLayer() { - delete timer_; + timer = boost::shared_ptr<Timer>(new Timer(TIMEOUT_MILLISECONDS)); + timer->onTick.connect(boost::bind(&WhitespacePingLayer::handleTimerTick, this)); + timer->start(); } void WhitespacePingLayer::writeData(const ByteArray& data) { |