diff --git a/Userland/Services/SQLServer/DatabaseConnection.cpp b/Userland/Services/SQLServer/DatabaseConnection.cpp index 4f5d032422..e83fccc925 100644 --- a/Userland/Services/SQLServer/DatabaseConnection.cpp +++ b/Userland/Services/SQLServer/DatabaseConnection.cpp @@ -38,7 +38,7 @@ DatabaseConnection::DatabaseConnection(String database_name, int client_id) dbgln_if(SQLSERVER_DEBUG, "DatabaseConnection {} initiating connection with database '{}'", connection_id(), m_database_name); s_connections.set(m_connection_id, *this); - deferred_invoke([&] { + deferred_invoke([this]() { 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(m_client_id); @@ -53,7 +53,7 @@ void DatabaseConnection::disconnect() { dbgln_if(SQLSERVER_DEBUG, "DatabaseConnection::disconnect(connection_id {}, database '{}'", connection_id(), m_database_name); m_accept_statements = false; - deferred_invoke([&] { + deferred_invoke([this]() { m_database = nullptr; s_connections.remove(m_connection_id); auto client_connection = ClientConnection::client_connection_for(client_id()); diff --git a/Userland/Services/SQLServer/SQLStatement.cpp b/Userland/Services/SQLServer/SQLStatement.cpp index 6b8ed2f525..87c726beee 100644 --- a/Userland/Services/SQLServer/SQLStatement.cpp +++ b/Userland/Services/SQLServer/SQLStatement.cpp @@ -60,7 +60,7 @@ void SQLStatement::execute() return; } - deferred_invoke([&] { + deferred_invoke([this]() { auto maybe_error = parse(); if (maybe_error.has_value()) { report_error(maybe_error.value()); @@ -107,7 +107,7 @@ void SQLStatement::next() if (m_index < m_result->results().size()) { auto& tuple = m_result->results()[m_index++]; client_connection->async_next_result(statement_id(), tuple.to_string_vector()); - deferred_invoke([&] { + deferred_invoke([this]() { next(); }); } else {