summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/engine
diff options
context:
space:
mode:
authorlipalani@chromium.org <lipalani@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-21 23:27:40 +0000
committerlipalani@chromium.org <lipalani@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-21 23:27:40 +0000
commite2b378d8f1b9cbd19c9cdf141649252a25d721e9 (patch)
treebeb07f9de10fd1bec09672b505d4863304a48bc3 /chrome/browser/sync/engine
parent91ed478bd7f9865336dcdcb72a12fadf97c817e4 (diff)
downloadchromium_src-e2b378d8f1b9cbd19c9cdf141649252a25d721e9.zip
chromium_src-e2b378d8f1b9cbd19c9cdf141649252a25d721e9.tar.gz
chromium_src-e2b378d8f1b9cbd19c9cdf141649252a25d721e9.tar.bz2
Fix a memory leak by moving the creation of the object close the call for making the lined pointer.
BUG=79568 TEST= Review URL: http://codereview.chromium.org/6880021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82580 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/engine')
-rw-r--r--chrome/browser/sync/engine/syncer_thread.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/chrome/browser/sync/engine/syncer_thread.cc b/chrome/browser/sync/engine/syncer_thread.cc
index 5600d70..a95497b 100644
--- a/chrome/browser/sync/engine/syncer_thread.cc
+++ b/chrome/browser/sync/engine/syncer_thread.cc
@@ -697,23 +697,22 @@ void SyncerThread::HandleConsecutiveContinuationError(
if (IsBackingOff()) {
DCHECK(wait_interval_->timer.IsRunning() || old_job.is_canary_job);
}
- SyncSession* old = old_job.session.get();
- SyncSession* s(new SyncSession(session_context_.get(), this,
- old->source(), old->routing_info(), old->workers()));
+
TimeDelta length = delay_provider_->GetDelay(
IsBackingOff() ? wait_interval_->length : TimeDelta::FromSeconds(1));
VLOG(1) << "SyncerThread(" << this << ")"
<< " In handle continuation error. Old job purpose is "
- << old_job.purpose;
- VLOG(1) << "SyncerThread(" << this << ")"
- << " In Handle continuation error. The time delta(ms) is: "
+ << old_job.purpose << " . The time delta(ms) is "
<< length.InMilliseconds();
// This will reset the had_nudge variable as well.
wait_interval_.reset(new WaitInterval(WaitInterval::EXPONENTIAL_BACKOFF,
length));
if (old_job.purpose == SyncSessionJob::CONFIGURATION) {
+ SyncSession* old = old_job.session.get();
+ SyncSession* s(new SyncSession(session_context_.get(), this,
+ old->source(), old->routing_info(), old->workers()));
SyncSessionJob job(old_job.purpose, TimeTicks::Now() + length,
make_linked_ptr(s), false, FROM_HERE);
wait_interval_->pending_configure_job.reset(new SyncSessionJob(job));