From e30ecacb712ccaf58552c1dde742c01cc71afda7 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Wed, 22 Nov 2023 09:49:10 -0700 Subject: [PATCH] WebWorker: Exit the event loop when the connection from the client dies This mimics the behavior of other services, and prevents zombie service processes from sticking around when no longer needed. --- Userland/Services/WebWorker/ConnectionFromClient.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Userland/Services/WebWorker/ConnectionFromClient.cpp b/Userland/Services/WebWorker/ConnectionFromClient.cpp index 72fb2fdc90..9087912a65 100644 --- a/Userland/Services/WebWorker/ConnectionFromClient.cpp +++ b/Userland/Services/WebWorker/ConnectionFromClient.cpp @@ -12,7 +12,9 @@ namespace WebWorker { void ConnectionFromClient::die() { - // FIXME: Do something here (shutdown process/script gracefully?) + // FIXME: When handling multiple workers in the same process, + // this logic needs to be smarter (only when all workers are dead, etc). + Core::EventLoop::current().quit(0); } void ConnectionFromClient::request_file(Web::FileRequest request)