mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-27 03:39:04 +00:00
TelnetServer: Defer removal of client from clients HashMap
This is necessary to avoid trying to destruct the on_ready_to_read function from inside the function.
This commit is contained in:
parent
f645ed199e
commit
f4c181da9d
Notes:
sideshowbarker
2024-07-18 02:01:28 +09:00
Author: https://github.com/bcoles
Commit: f4c181da9d
Pull-request: https://github.com/SerenityOS/serenity/pull/10592
1 changed files with 3 additions and 1 deletions
|
@ -135,7 +135,9 @@ int main(int argc, char** argv)
|
|||
run_command(ptm_fd, command);
|
||||
|
||||
auto client = Client::create(id, move(client_socket), ptm_fd);
|
||||
client->on_exit = [&clients, id] { clients.remove(id); };
|
||||
client->on_exit = [&clients, id] {
|
||||
Core::deferred_invoke([&clients, id] { clients.remove(id); });
|
||||
};
|
||||
clients.set(id, client);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue