diff options
author | johnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-10 01:41:12 +0000 |
---|---|---|
committer | johnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-10 01:41:12 +0000 |
commit | 05b44a37074316aed12341f9a1296fff2c1afafb (patch) | |
tree | 7ea390e4ae7c68a3569be39d1281c40a204a4ce5 /chrome/browser/sync | |
parent | a54d402c3bf0a74aff9e4fa04f86b8818c6ebe3a (diff) | |
download | chromium_src-05b44a37074316aed12341f9a1296fff2c1afafb.zip chromium_src-05b44a37074316aed12341f9a1296fff2c1afafb.tar.gz chromium_src-05b44a37074316aed12341f9a1296fff2c1afafb.tar.bz2 |
Fix a leak when syncapi is used in test mode, where the session context was being created but not handed over to the syncer thread.
BUG=55031
TEST=unit tests
Review URL: http://codereview.chromium.org/3374002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59031 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync')
-rw-r--r-- | chrome/browser/sync/engine/syncapi.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/chrome/browser/sync/engine/syncapi.cc b/chrome/browser/sync/engine/syncapi.cc index f6ab657..3efb731 100644 --- a/chrome/browser/sync/engine/syncapi.cc +++ b/chrome/browser/sync/engine/syncapi.cc @@ -1327,15 +1327,14 @@ bool SyncManager::SyncInternal::Init( // Listen to TalkMediator events ourselves talk_mediator_->SetDelegate(this); - LOG(INFO) << "Sync is bringing up SyncSessionContext."; - - // Build a SyncSessionContext and store the worker in it. - SyncSessionContext* context = new SyncSessionContext( - connection_manager_.get(), dir_manager(), model_safe_worker_registrar); - - // The SyncerThread takes ownership of |context|. Test mode does not - // use an actual syncer thread. + // Test mode does not use a syncer context or syncer thread. if (!setup_for_test_mode) { + // Build a SyncSessionContext and store the worker in it. + LOG(INFO) << "Sync is bringing up SyncSessionContext."; + SyncSessionContext* context = new SyncSessionContext( + connection_manager_.get(), dir_manager(), model_safe_worker_registrar); + + // The SyncerThread takes ownership of |context|. syncer_thread_ = new SyncerThread(context); allstatus_.WatchSyncerThread(syncer_thread()); |