Commit 9f10ab05 authored by Xiyuan Xia's avatar Xiyuan Xia Committed by Commit Bot

cros: Fix MachineLearningDecisionServiceProvider shutdown crash

Release MachineLearningDecisionServiceProvider before tearing
down ash to fix the crash.

Bug: 987687
Change-Id: Ice42d1c50b0534d5f8386038087b74a84bd6969c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1719447Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Commit-Queue: Xiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681421}
parent 427b2ca2
...@@ -426,13 +426,17 @@ class DBusServices { ...@@ -426,13 +426,17 @@ class DBusServices {
vm_applications_service_.reset(); vm_applications_service_.reset();
drive_file_stream_service_.reset(); drive_file_stream_service_.reset();
cryptohome_key_delegate_service_.reset(); cryptohome_key_delegate_service_.reset();
machine_learning_decision_service_.reset();
ProcessDataCollector::Shutdown(); ProcessDataCollector::Shutdown();
PowerDataCollector::Shutdown(); PowerDataCollector::Shutdown();
PowerPolicyController::Shutdown(); PowerPolicyController::Shutdown();
device::BluetoothAdapterFactory::Shutdown(); device::BluetoothAdapterFactory::Shutdown();
} }
void PreAshShutdown() {
// Services depending on ash should be released here.
machine_learning_decision_service_.reset();
}
private: private:
std::unique_ptr<CrosDBusService> proxy_resolution_service_; std::unique_ptr<CrosDBusService> proxy_resolution_service_;
std::unique_ptr<CrosDBusService> kiosk_info_service_; std::unique_ptr<CrosDBusService> kiosk_info_service_;
...@@ -1191,6 +1195,9 @@ void ChromeBrowserMainPartsChromeos::PostMainMessageLoopRun() { ...@@ -1191,6 +1195,9 @@ void ChromeBrowserMainPartsChromeos::PostMainMessageLoopRun() {
language::prefs::kApplicationLocale)); language::prefs::kApplicationLocale));
} }
// Cleans up dbus services depending on ash.
dbus_services_->PreAshShutdown();
// NOTE: Closes ash and destroys ash::Shell. // NOTE: Closes ash and destroys ash::Shell.
ChromeBrowserMainPartsLinux::PostMainMessageLoopRun(); ChromeBrowserMainPartsLinux::PostMainMessageLoopRun();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment