mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-11 01:06:01 +03:00
SQLServer: Use m_client_id instead of client_id in callback
In the DatabaseConnection constructor, there's a deferred_invoke callback that references the client_id. But depending on when the callback occurs, the reference of the client_id can change. This created a problem when connecting to SQLServer using the SQL utility because depending on when the callback was invoked, the client_id could change. m_client_id is set in the constructor and that reference will not change depending on when the callback is invoked.
This commit is contained in:
parent
9a4c1c019a
commit
e4f040147f
Notes:
sideshowbarker
2024-07-18 05:23:30 +09:00
Author: https://github.com/rstefanic Commit: https://github.com/SerenityOS/serenity/commit/e4f040147f3 Pull-request: https://github.com/SerenityOS/serenity/pull/9556 Reviewed-by: https://github.com/JanDeVisser Reviewed-by: https://github.com/awesomekling
@ -41,7 +41,7 @@ DatabaseConnection::DatabaseConnection(String database_name, int client_id)
|
||||
deferred_invoke([&](Object&) {
|
||||
m_database = SQL::Database::construct(String::formatted("/home/anon/sql/{}.db", m_database_name));
|
||||
m_accept_statements = true;
|
||||
auto client_connection = ClientConnection::client_connection_for(client_id);
|
||||
auto client_connection = ClientConnection::client_connection_for(m_client_id);
|
||||
if (client_connection)
|
||||
client_connection->async_connected(m_connection_id);
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user