Index: mojo/shell/in_process_dynamic_service_runner.cc |
diff --git a/mojo/shell/in_process_dynamic_service_runner.cc b/mojo/shell/in_process_dynamic_service_runner.cc |
index 834f20a4fe0411a21ee786ab1cc065d3c00fbb6b..3bfb163462ce500a29cc80b8d3d235397d6ea136 100644 |
--- a/mojo/shell/in_process_dynamic_service_runner.cc |
+++ b/mojo/shell/in_process_dynamic_service_runner.cc |
@@ -16,14 +16,14 @@ namespace shell { |
InProcessDynamicServiceRunner::InProcessDynamicServiceRunner( |
Context* context) |
- : keep_alive_(context), |
- thread_(this, "app_thread") { |
+ : keep_alive_(context) { |
} |
InProcessDynamicServiceRunner::~InProcessDynamicServiceRunner() { |
- if (thread_.HasBeenStarted()) { |
- DCHECK(!thread_.HasBeenJoined()); |
- thread_.Join(); |
+ if (thread_) { |
+ DCHECK(thread_->HasBeenStarted()); |
+ DCHECK(!thread_->HasBeenJoined()); |
+ thread_->Join(); |
} |
// It is important to let the thread exit before unloading the DSO because |
@@ -47,8 +47,9 @@ void InProcessDynamicServiceRunner::Start( |
FROM_HERE, |
app_completed_callback); |
- DCHECK(!thread_.HasBeenStarted()); |
- thread_.Start(); |
+ DCHECK(!thread_); |
+ thread_.reset(new base::DelegateSimpleThread(this, "app_thread")); |
+ thread_->Start(); |
} |
void InProcessDynamicServiceRunner::Run() { |