diff options
Diffstat (limited to 'chrome/browser/task_manager.cc')
-rw-r--r-- | chrome/browser/task_manager.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/chrome/browser/task_manager.cc b/chrome/browser/task_manager.cc index 7a7a252..c4e186b 100644 --- a/chrome/browser/task_manager.cc +++ b/chrome/browser/task_manager.cc @@ -688,6 +688,9 @@ bool TaskManagerModel::GetProcessMetricsForRows( //////////////////////////////////////////////////////////////////////////////// // static +bool TaskManager::initialized_ = false; + +// static void TaskManager::RegisterPrefs(PrefService* prefs) { prefs->RegisterDictionaryPref(prefs::kTaskManagerWindowPlacement); } @@ -695,6 +698,7 @@ void TaskManager::RegisterPrefs(PrefService* prefs) { TaskManager::TaskManager() : ALLOW_THIS_IN_INITIALIZER_LIST(model_(new TaskManagerModel(this))) { Init(); + initialized_ = true; } TaskManager::~TaskManager() { @@ -711,6 +715,19 @@ void TaskManager::Close() { model_->Clear(); } +// static +void TaskManager::EnsureShutdown() { + if (!initialized_) + return; + + // TaskManager is a singleton, which means it's destroyed by AtExitManager. + // At that point it can't register AtExit callbacks etc. It turns out that + // view destruction code does it on Windows, so we destroy the view now. + TaskManager* task_manager = GetInstance(); + task_manager->view_.reset(); + initialized_ = false; +} + bool TaskManager::BrowserProcessIsSelected() { if (!view_.get()) return false; |