Skip to content

Truly independent web browser

LibWebView: Read what a worker said before noticing that it exited

Andreas Klingfb80e60e6b91
diff --git a/Libraries/LibWebView/Application.cpp b/Libraries/LibWebView/Application.cpp
index 7844f646a17..310bcf5b320 100644
--- a/Libraries/LibWebView/Application.cpp
+++ b/Libraries/LibWebView/Application.cpp
@@ -2397,7 +2397,9 @@ void Application::process_did_exit(Process&& process, Optional<int>)
}
break;
case ProcessType::WebWorker:
- dbgln_if(WEBVIEW_PROCESS_DEBUG, "WebWorker {} died, not sure what to do.", process.pid());
+ // NB: A worker that closes itself says so and exits right away, and this can come ahead of what it said.
+ if (auto client = process.client<WebWorkerClient>())
+ client->dispatch_pending_messages();
break;
case ProcessType::Browser:
dbgln("Invalid process type to be dying: Browser");