Browse Source

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.
Andrew Kaster 1 year ago
parent
commit
e30ecacb71
1 changed files with 3 additions and 1 deletions
  1. 3 1
      Userland/Services/WebWorker/ConnectionFromClient.cpp

+ 3 - 1
Userland/Services/WebWorker/ConnectionFromClient.cpp

@@ -12,7 +12,9 @@ namespace WebWorker {
 
 
 void ConnectionFromClient::die()
 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)
 void ConnectionFromClient::request_file(Web::FileRequest request)