mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
Ladybird: Quit SQLServer when its connected client exits
When Ladybird exits, SQLServer can get stuck spinning at 100% CPU after the socket connection is closed. This changes the client to quit the event loop when that disconnect happens to ensure that SQLServer is properly destroyed.
This commit is contained in:
parent
e54932ee73
commit
1dd14e1324
Notes:
sideshowbarker
2024-07-17 02:38:12 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/1dd14e1324 Pull-request: https://github.com/SerenityOS/serenity/pull/16583 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/awesomekling ✅ Reviewed-by: https://github.com/linusg
1 changed files with 3 additions and 0 deletions
|
@ -36,6 +36,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
auto client = TRY(SQLServer::ConnectionFromClient::try_create(move(socket), 1));
|
||||
client->set_fd_passing_socket(TRY(Core::Stream::LocalSocket::adopt_fd(sql_server_fd_passing_socket)));
|
||||
client->set_database_path(move(database_path));
|
||||
client->on_disconnect = [&]() {
|
||||
loop.quit(0);
|
||||
};
|
||||
|
||||
return loop.exec();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue