1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:57:34 +00:00

WebDriver: Defer removing closed window handles until no longer needed

WebDriver::Session::close_window may invoke Session::stop, which needs
the WebContent connection to still exist. Do not remove the window's
handle (thus destroying the connection) until it is no longer needed.
This commit is contained in:
Timothy Flynn 2023-03-07 09:16:01 -05:00 committed by Linus Groh
parent ae1611aa08
commit 7be8931ca0
2 changed files with 15 additions and 8 deletions

View file

@ -36,8 +36,10 @@ public:
WebContentConnection& web_content_connection() const
{
auto const& current_window = m_windows.get(m_current_window_handle).value();
return current_window.web_content_connection;
auto current_window = m_windows.get(m_current_window_handle);
VERIFY(current_window.has_value());
return current_window->web_content_connection;
}
String const& current_window_handle() const