LibWeb: Exit the current process when event loop quits during spin_until
This is a LibWeb special. We keep running into cases where we end up with one or more Platform or event loop spin_until() calls on the stack after the event loop has been cancelled and the WebContent process has been asked to exit. To prevent too much nonsense from exiting processes early from affecting our other, more well-behaved processes, put this special logic in the critical path of such Web-specific event loop spins.
This commit is contained in:
parent
16f72ca36c
commit
edfaa76c90
1 changed files with 2 additions and 0 deletions
|
|
@ -17,6 +17,8 @@ EventLoopPluginSerenity::~EventLoopPluginSerenity() = default;
|
|||
void EventLoopPluginSerenity::spin_until(GC::Root<GC::Function<bool()>> goal_condition)
|
||||
{
|
||||
Core::EventLoop::current().spin_until([goal_condition = move(goal_condition)]() {
|
||||
if (Core::EventLoop::current().was_exit_requested())
|
||||
::exit(0);
|
||||
return goal_condition->function()();
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue