mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 09:49:15 +03:00
LibCore: Pop the main Core::EventLoop off the stack when destroyed
The main event loop pushes itself onto the event loop stack, and so it should also pop itself when destroyed. This will surface attempts to use the event loop stack after the main event loop has been destroyed.
This commit is contained in:
parent
3bed7d5a5e
commit
fa753ff863
Notes:
sideshowbarker
2024-07-18 01:57:21 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/fa753ff863e
@ -293,6 +293,11 @@ EventLoop::EventLoop([[maybe_unused]] MakeInspectable make_inspectable)
|
||||
|
||||
EventLoop::~EventLoop()
|
||||
{
|
||||
// NOTE: Pop the main event loop off of the stack when destroyed.
|
||||
if (this == s_main_event_loop) {
|
||||
s_event_loop_stack->take_last();
|
||||
s_main_event_loop = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
bool connect_to_inspector_server()
|
||||
|
Loading…
Reference in New Issue
Block a user