Index: sync/engine/sync_scheduler_impl.cc |
diff --git a/sync/engine/sync_scheduler_impl.cc b/sync/engine/sync_scheduler_impl.cc |
index 76a72f03272b1f69efa44b45115561aabe8359e5..f07825e669f127ccd779f66a2d257b4a9ca93acf 100644 |
--- a/sync/engine/sync_scheduler_impl.cc |
+++ b/sync/engine/sync_scheduler_impl.cc |
@@ -316,6 +316,7 @@ bool SyncSchedulerImpl::ScheduleConfiguration( |
DCHECK(IsConfigRelatedUpdateSourceValue(params.source)); |
DCHECK_EQ(CONFIGURATION_MODE, mode_); |
DCHECK(!params.ready_task.is_null()); |
+ CHECK(started_) << "Scheduler must be running to configure."; |
SDVLOG(2) << "Reconfiguring syncer."; |
// Only one configuration is allowed at a time. Verify we're not waiting |
@@ -594,6 +595,12 @@ void SyncSchedulerImpl::ScheduleNudgeImpl( |
DCHECK_EQ(MessageLoop::current(), sync_loop_); |
DCHECK(!invalidation_map.empty()) << "Nudge scheduled for no types!"; |
+ if (!started_) { |
+ SDVLOG_LOC(nudge_location, 2) |
+ << "Dropping nudge, scheduler is not running."; |
+ return; |
+ } |
+ |
SDVLOG_LOC(nudge_location, 2) |
<< "In ScheduleNudgeImpl with delay " |
<< delay.InMilliseconds() << " ms, " |
@@ -992,6 +999,8 @@ void SyncSchedulerImpl::StopImpl(const base::Closure& callback) { |
weak_ptr_factory_.InvalidateWeakPtrs(); |
wait_interval_.reset(); |
poll_timer_.Stop(); |
+ unscheduled_nudge_storage_.reset(); |
+ pending_nudge_ = NULL; |
if (started_) { |
started_ = false; |
} |