Skip to content

Commit da84976

Browse files
committed
LibWebView: Support process exit handling on Windows
Now that we detect and handle child processes exiting, we should see less "Trying to post_message during IPC shutdown" VERIFY failures that crash the UI process.
1 parent 4dda455 commit da84976

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Libraries/LibWebView/ProcessMonitor.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ ProcessMonitor::ProcessMonitor(Function<void(pid_t)> exit_handler)
3535
ProcessMonitor::~ProcessMonitor()
3636
{
3737
#if defined(AK_OS_WINDOWS)
38-
// FIXME: Unregister all processes from the event loop on Windows
38+
for (pid_t pid : m_monitored_processes) {
39+
Core::EventLoop::unregister_process(pid);
40+
}
3941
#else
4042
Core::EventLoop::unregister_signal(m_signal_handle);
4143
#endif
@@ -45,7 +47,9 @@ void ProcessMonitor::add_process(pid_t pid)
4547
{
4648
m_monitored_processes.set(pid, AK::HashSetExistingEntryBehavior::Keep);
4749
#if defined(AK_OS_WINDOWS)
48-
// FIXME: Register the process with the event loop on Windows
50+
Core::EventLoop::register_process(pid, [this](pid_t pid) {
51+
m_on_process_exit(pid);
52+
});
4953
#endif
5054
}
5155

0 commit comments

Comments
 (0)