Skip to content

Truly independent web browser

LibWebView: Forget a helper's transport registration once it exits

Jelle Raaijmakersa630a04d1aa8
diff --git a/Libraries/LibWebView/Application.cpp b/Libraries/LibWebView/Application.cpp
index 586b7ad6e1d..2cafff3b703 100644
--- a/Libraries/LibWebView/Application.cpp
+++ b/Libraries/LibWebView/Application.cpp
@@ -2260,6 +2260,12 @@ Optional<Process&> Application::find_process(pid_t pid)
void Application::process_did_exit(Process&& process, Optional<int>)
{
+#if defined(AK_OS_MACOS)
+ // A helper that exits before it fetches its transport leaves its ports registered. Holding them would keep the
+ // other end of the transport from noticing that the helper is gone.
+ m_transport_bootstrap_server.unregister_child_transport(process.pid());
+#endif
+
if (m_event_loop->was_exit_requested())
return;