mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-14 02:46:57 +02:00
LibGUI: Always close() Dialogs no matter the execution result
Fixes Blocking modal race conditions when new windows are created in the same scope as Dialogs.
This commit is contained in:
committed by
Andreas Kling
parent
2028fbeae3
commit
5c923977b7
Notes:
sideshowbarker
2024-07-17 04:18:25 +09:00
Author: https://github.com/thankyouverycool Commit: https://github.com/SerenityOS/serenity/commit/5c923977b7 Pull-request: https://github.com/SerenityOS/serenity/pull/16098
@@ -112,6 +112,8 @@ Dialog::ExecResult Dialog::exec()
|
||||
|
||||
void Dialog::done(ExecResult result)
|
||||
{
|
||||
Window::close();
|
||||
|
||||
if (!m_event_loop)
|
||||
return;
|
||||
m_result = result;
|
||||
@@ -137,7 +139,6 @@ void Dialog::event(Core::Event& event)
|
||||
|
||||
void Dialog::close()
|
||||
{
|
||||
Window::close();
|
||||
done(ExecResult::Cancel);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user