summaryrefslogtreecommitdiffstats
path: root/chrome_frame/chrome_frame_activex_base.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome_frame/chrome_frame_activex_base.h')
-rw-r--r--chrome_frame/chrome_frame_activex_base.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/chrome_frame/chrome_frame_activex_base.h b/chrome_frame/chrome_frame_activex_base.h
index f4a276e..85432ef 100644
--- a/chrome_frame/chrome_frame_activex_base.h
+++ b/chrome_frame/chrome_frame_activex_base.h
@@ -505,11 +505,13 @@ END_MSG_MAP()
LRESULT OnDestroy(UINT message, WPARAM wparam, LPARAM lparam,
BOOL& handled) { // NO_LINT
- worker_thread_.message_loop()->PostTask(
- FROM_HERE, NewRunnableMethod(this, &Base::OnWorkerStop));
- if (automation_client_.get())
- automation_client_->CleanupRequests();
- worker_thread_.Stop();
+ if (worker_thread_.message_loop()) {
+ worker_thread_.message_loop()->PostTask(
+ FROM_HERE, NewRunnableMethod(this, &Base::OnWorkerStop));
+ if (automation_client_.get())
+ automation_client_->CleanupAsyncRequests();
+ worker_thread_.Stop();
+ }
return 0;
}