diff options
author | Andreas Kling <kling@serenityos.org> | 2020-01-25 10:21:44 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-01-25 10:34:32 +0100 |
commit | 60d5b06e2163606d2f9a5e84d1e48038072d5c78 (patch) | |
tree | 78dec0269fe566fb5eb81e73181c7decb31b2e1f | |
parent | 74829cdb753086323fef867cdd1469adfd7ee431 (diff) | |
download | serenity-60d5b06e2163606d2f9a5e84d1e48038072d5c78.zip |
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.
-rw-r--r-- | Servers/WindowServer/WSClientConnection.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Servers/WindowServer/WSClientConnection.cpp b/Servers/WindowServer/WSClientConnection.cpp index 114a98ed5d..0b02575837 100644 --- a/Servers/WindowServer/WSClientConnection.cpp +++ b/Servers/WindowServer/WSClientConnection.cpp @@ -81,7 +81,9 @@ WSClientConnection::~WSClientConnection() 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) |