summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/LinkRegistry.cpp
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2009-08-07 01:53:50 +0000
committerAndrew Stitcher <astitcher@apache.org>2009-08-07 01:53:50 +0000
commitdb71c1d728864e41d8be7c5c91c0a7e84940284c (patch)
treee36ae760ef5dd1c29ea956dcd70bf9786dbdaa96 /cpp/src/qpid/broker/LinkRegistry.cpp
parent038e48fa0110f682806e34e34a22ab75c6f51da9 (diff)
downloadqpid-python-db71c1d728864e41d8be7c5c91c0a7e84940284c.tar.gz
Change LinkRegistry to cancel its TimerTask in its destructor
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@801860 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/LinkRegistry.cpp')
-rw-r--r--cpp/src/qpid/broker/LinkRegistry.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/cpp/src/qpid/broker/LinkRegistry.cpp b/cpp/src/qpid/broker/LinkRegistry.cpp
index c70392eb23..fc7b88a04a 100644
--- a/cpp/src/qpid/broker/LinkRegistry.cpp
+++ b/cpp/src/qpid/broker/LinkRegistry.cpp
@@ -49,10 +49,16 @@ LinkRegistry::LinkRegistry () :
LinkRegistry::LinkRegistry (Broker* _broker) :
broker(_broker), timer(&broker->getTimer()),
+ maintenanceTask(new Periodic(*this)),
parent(0), store(0), passive(false), passiveChanged(false),
realm(broker->getOptions().realm)
{
- timer->add (new Periodic(*this));
+ timer->add(maintenanceTask);
+}
+
+LinkRegistry::~LinkRegistry()
+{
+ maintenanceTask->cancel();
}
LinkRegistry::Periodic::Periodic (LinkRegistry& _links) :
@@ -61,7 +67,8 @@ LinkRegistry::Periodic::Periodic (LinkRegistry& _links) :
void LinkRegistry::Periodic::fire ()
{
links.periodicMaintenance ();
- links.timer->add (new Periodic(links));
+ setupNextFire();
+ links.timer->add (this);
}
void LinkRegistry::periodicMaintenance ()