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 21:52:01 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-23 21:52:01 +0000
commitdc7af3c01d667fa2ddc6a9d75c73d0c12fd2137c (patch)
treeadb8ce1c4a629ae9cf9f83bdf64710e6ac0f0353 /chrome/browser/user_data_manager.cc
parent292170bc90dc4a80156990a5cf18c2acec4ae547 (diff)
downloadchromium_src-dc7af3c01d667fa2ddc6a9d75c73d0c12fd2137c.zip
chromium_src-dc7af3c01d667fa2ddc6a9d75c73d0c12fd2137c.tar.gz
chromium_src-dc7af3c01d667fa2ddc6a9d75c73d0c12fd2137c.tar.bz2
Fixes leak of UserDataManager on shutdown.
BUG=none TEST=none Review URL: http://codereview.chromium.org/18714 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8581 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