1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 09:17:35 +00:00

WindowServer: Tear down WSClientConnection asynchronously

If something goes wrong when trying to message a windowing client,
we now tear it down *on next event loop* instead of immediately.

This avoids having to deal with disconnected windows suddenly
disappearing from window lists while looping over them.
This commit is contained in:
Andreas Kling 2020-01-25 10:21:44 +01:00
parent 74829cdb75
commit 60d5b06e21

View file

@ -81,7 +81,9 @@ WSClientConnection::~WSClientConnection()
void WSClientConnection::die() void WSClientConnection::die()
{ {
s_connections->remove(client_id()); deferred_invoke([this](auto&) {
s_connections->remove(client_id());
});
} }
void WSClientConnection::notify_about_new_screen_rect(const Rect& rect) void WSClientConnection::notify_about_new_screen_rect(const Rect& rect)