mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-12 02:30:30 +09:00
LibCore: Fix event loop stacks on non-main threads
Previously, event loop stacks on non-main threads would always crash because the condition for "am I the lowest-stacked loop" was still "am I the main loop", which of course is no longer sensible. A simple switch to `is_instantiated` fixes this.
This commit is contained in:
parent
93496af02b
commit
716a3429fa
Notes:
sideshowbarker
2024-07-17 18:52:51 +09:00
Author: https://github.com/kleinesfilmroellchen
Commit: 716a3429fa
Pull-request: https://github.com/SerenityOS/serenity/pull/12436
Reviewed-by: https://github.com/ADKaster
1 changed files with 2 additions and 2 deletions
|
@ -396,14 +396,14 @@ public:
|
|||
EventLoopPusher(EventLoop& event_loop)
|
||||
: m_event_loop(event_loop)
|
||||
{
|
||||
if (!is_main_event_loop()) {
|
||||
if (EventLoop::has_been_instantiated()) {
|
||||
m_event_loop.take_pending_events_from(EventLoop::current());
|
||||
s_event_loop_stack->append(event_loop);
|
||||
}
|
||||
}
|
||||
~EventLoopPusher()
|
||||
{
|
||||
if (!is_main_event_loop()) {
|
||||
if (EventLoop::has_been_instantiated()) {
|
||||
s_event_loop_stack->take_last();
|
||||
EventLoop::current().take_pending_events_from(m_event_loop);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue