Index: athena/system/system_ui_impl.cc |
diff --git a/athena/system/system_ui_impl.cc b/athena/system/system_ui_impl.cc |
index 39867ad96d81db742ea72b3c1f9fa8763b5c431a..b3bacb5f77b98c3eb9697891e96d120941afbd7d 100644 |
--- a/athena/system/system_ui_impl.cc |
+++ b/athena/system/system_ui_impl.cc |
@@ -18,13 +18,16 @@ SystemUI* instance = NULL; |
class SystemUIImpl : public SystemUI { |
public: |
- SystemUIImpl(scoped_refptr<base::TaskRunner> io_task_runner) |
+ SystemUIImpl(scoped_refptr<base::TaskRunner> file_task_runner) |
: orientation_controller_(new OrientationController()), |
power_button_controller_(new PowerButtonController) { |
- orientation_controller_->InitWith(io_task_runner); |
+ orientation_controller_->InitWith(file_task_runner); |
} |
virtual ~SystemUIImpl() { |
+ // Stops file watching now if exists. Waiting until message loop shutdon |
+ // leads to FilePathWatcher crash. |
+ orientation_controller_->Shutdown(); |
} |
private: |
@@ -37,10 +40,9 @@ class SystemUIImpl : public SystemUI { |
} // namespace |
// static |
-SystemUI* SystemUI::Create( |
- scoped_refptr<base::TaskRunner> io_task_runner) { |
- DeviceSocketListener::CreateSocketManager(io_task_runner); |
- instance = new SystemUIImpl(io_task_runner); |
+SystemUI* SystemUI::Create(scoped_refptr<base::TaskRunner> file_task_runner) { |
+ DeviceSocketListener::CreateSocketManager(file_task_runner); |
+ instance = new SystemUIImpl(file_task_runner); |
return instance; |
} |