mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:07:34 +00:00
WebDriver: Inline Sesssion::stop()
in session destructor
Previously it was possible to have following sequence of calls while destroying a session: 1. `WebContentConnection::die()` calls `Client::close_session()` 2. `Client::close_session()` removes a session from active sessions map which causes session destructor call. 3. Session destructor calls `Client::close_session()` to remove a session from active sessions. With `stop()` method inlined into destructor `close_session()` need to be called just once while destroying a session.
This commit is contained in:
parent
b79cd5cf6e
commit
63c16ff41a
3 changed files with 23 additions and 34 deletions
|
@ -185,7 +185,7 @@ Web::WebDriver::Response Client::delete_session(Web::WebDriver::Parameters param
|
|||
|
||||
// 1. If the current session is an active session, try to close the session.
|
||||
if (auto session = find_session_with_id(parameters[0]); !session.is_error())
|
||||
TRY(session.value()->stop());
|
||||
close_session(session.value()->session_id());
|
||||
|
||||
// 2. Return success with data null.
|
||||
return JsonValue {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue