From 46a36f766f77f40268bfbcc32103a6025965d82f Mon Sep 17 00:00:00 2001 From: orignal Date: Wed, 21 Jan 2015 16:34:50 -0500 Subject: [PATCH] don't restart subscriptions update timer if no subscription presented --- AddressBook.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/AddressBook.cpp b/AddressBook.cpp index f78666a0..a77b7194 100644 --- a/AddressBook.cpp +++ b/AddressBook.cpp @@ -355,10 +355,13 @@ namespace client void AddressBook::DownloadComplete (bool success) { m_IsDownloading = false; - m_SubscriptionsUpdateTimer->expires_from_now (boost::posix_time::minutes( - success ? CONTINIOUS_SUBSCRIPTION_UPDATE_TIMEOUT : CONTINIOUS_SUBSCRIPTION_RETRY_TIMEOUT)); - m_SubscriptionsUpdateTimer->async_wait (std::bind (&AddressBook::HandleSubscriptionsUpdateTimer, - this, std::placeholders::_1)); + if (m_SubscriptionsUpdateTimer) + { + m_SubscriptionsUpdateTimer->expires_from_now (boost::posix_time::minutes( + success ? CONTINIOUS_SUBSCRIPTION_UPDATE_TIMEOUT : CONTINIOUS_SUBSCRIPTION_RETRY_TIMEOUT)); + m_SubscriptionsUpdateTimer->async_wait (std::bind (&AddressBook::HandleSubscriptionsUpdateTimer, + this, std::placeholders::_1)); + } } void AddressBook::StartSubscriptions ()