Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(563)

Unified Diff: chrome/browser/task_manager/providers/arc/arc_process_task.cc

Issue 2625823005: arc: Fix crash in arc_process_task.cc during browser shutdown (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/task_manager/providers/arc/arc_process_task.cc
diff --git a/chrome/browser/task_manager/providers/arc/arc_process_task.cc b/chrome/browser/task_manager/providers/arc/arc_process_task.cc
index e0b44c0825700c1fce30a2f988aab6f9e4d6840d..6b32713dd621529b5140de183f99e6bec2c4a1bd 100644
--- a/chrome/browser/task_manager/providers/arc/arc_process_task.cc
+++ b/chrome/browser/task_manager/providers/arc/arc_process_task.cc
@@ -113,10 +113,14 @@ void ArcProcessTask::StartIconLoading() {
}
ArcProcessTask::~ArcProcessTask() {
- arc::ArcServiceManager::Get()
- ->arc_bridge_service()
- ->intent_helper()
- ->RemoveObserver(this);
+ auto* service_manager = arc::ArcServiceManager::Get();
+ // This destructor can also be called when TaskManagerImpl is destructed.
+ // Since TaskManagerImpl is a LAZY_INSTANCE, arc::ArcServiceManager may have
+ // already been destructed. In that case, arc_bridge_service() has also been
+ // destructed, and it is safe to just return.
+ if (!service_manager)
+ return;
+ service_manager->arc_bridge_service()->intent_helper()->RemoveObserver(this);
}
Task::Type ArcProcessTask::GetType() const {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698