Commit 69b50d84 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

Workers: Free memory when worker is terminated before thread creation

In the case a dedicated worker is terminated before the backing thread
has been created the message proxy would never be cleaned up. With
unified heap this means that any wrappers may keep on to old window
objects.

Bug: 928781, 843903
Change-Id: Ic0f1968609d259a2eea9a4c90d47f95729b4ce79
Reviewed-on: https://chromium-review.googlesource.com/c/1458217Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#629949}
parent bacc196d
...@@ -146,8 +146,12 @@ void ThreadedMessagingProxyBase::TerminateGlobalScope() { ...@@ -146,8 +146,12 @@ void ThreadedMessagingProxyBase::TerminateGlobalScope() {
terminate_sync_load_event_.Signal(); terminate_sync_load_event_.Signal();
if (!worker_thread_) if (!worker_thread_) {
// Worker has been terminated before any backing thread was attached to the
// messaging proxy.
keep_alive_.Clear();
return; return;
}
worker_thread_->Terminate(); worker_thread_->Terminate();
DevToolsAgent::WorkerThreadTerminated(execution_context_.Get(), DevToolsAgent::WorkerThreadTerminated(execution_context_.Get(),
worker_thread_.get()); worker_thread_.get());
......
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