summaryrefslogtreecommitdiffstats
path: root/chrome/browser/user_data_manager.cc
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-23 22:19:32 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-23 22:19:32 +0000
commitc6bbd46c7a5b0d8b74a180e06cd45f6dd8ac18a4 (patch)
tree13ea96d790fdc45b170d6f16bbb25f0498a11f0a /chrome/browser/user_data_manager.cc
parent769a530e1017bbfad56115ff80cc1a0c6b8c6979 (diff)
downloadchromium_src-c6bbd46c7a5b0d8b74a180e06cd45f6dd8ac18a4.zip
chromium_src-c6bbd46c7a5b0d8b74a180e06cd45f6dd8ac18a4.tar.gz
chromium_src-c6bbd46c7a5b0d8b74a180e06cd45f6dd8ac18a4.tar.bz2
I'm relanding the UserDataManager leak fix. I didn't realize we had
stubs for mac which needed to be updated too. This time I'll wait for the bots to finish compiling before committing. BUG=none TEST=none TBR=munjal Review URL: http://codereview.chromium.org/18566 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8587 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/user_data_manager.cc')
-rw-r--r--chrome/browser/user_data_manager.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/chrome/browser/user_data_manager.cc b/chrome/browser/user_data_manager.cc
index 554c53f..bc078db 100644
--- a/chrome/browser/user_data_manager.cc
+++ b/chrome/browser/user_data_manager.cc
@@ -91,11 +91,12 @@ static const wchar_t kProfileFolderSeparator[] = L"-";
UserDataManager* UserDataManager::instance_ = NULL;
// static
-void UserDataManager::Create() {
+UserDataManager* UserDataManager::Create() {
DCHECK(!instance_);
std::wstring user_data;
PathService::Get(chrome::DIR_USER_DATA, &user_data);
instance_ = new UserDataManager(user_data);
+ return instance_;
}
// static
@@ -123,6 +124,8 @@ UserDataManager::UserDataManager(const std::wstring& user_data_root)
}
UserDataManager::~UserDataManager() {
+ if (instance_ == this)
+ instance_ = NULL;
}
// static