Moving out scheduler from dispatcher and sync-core constructors
diff --git a/src/sync-core.cc b/src/sync-core.cc
index 9d2003d..8c653f1 100644
--- a/src/sync-core.cc
+++ b/src/sync-core.cc
@@ -36,13 +36,13 @@
using namespace Ccnx;
SyncCore::SyncCore(SyncLogPtr syncLog, const Name &userName, const Name &localPrefix, const Name &syncPrefix,
- const StateMsgCallback &callback, CcnxWrapperPtr ccnx, SchedulerPtr scheduler)
+ const StateMsgCallback &callback, CcnxWrapperPtr ccnx)
: m_ccnx (ccnx)
, m_log(syncLog)
- , m_scheduler(scheduler)
- , m_stateMsgCallback(callback)
- , m_syncPrefix(syncPrefix)
- , m_recoverWaitGenerator(new RandomIntervalGenerator(WAIT, RANDOM_PERCENT, RandomIntervalGenerator::UP))
+ , m_scheduler(new Scheduler ())
+ , m_stateMsgCallback(callback)
+ , m_syncPrefix(syncPrefix)
+ , m_recoverWaitGenerator(new RandomIntervalGenerator(WAIT, RANDOM_PERCENT, RandomIntervalGenerator::UP))
{
m_rootHash = m_log->RememberStateInStateLog();
@@ -56,6 +56,7 @@
SyncCore::~SyncCore()
{
+ m_scheduler->shutdown ();
// need to "deregister" closures
}