mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:48:10 +00:00
WindowServer: Control WSClientConnection's window list teardown better
A lot of things happen in response to window destruction, and some of them may call into the window's WSClientConnection and ask it to look through its window list. If we're right in the middle of tearing down the window list, it's not a great idea to start iterating over it. Fixes #386.
This commit is contained in:
parent
a82c60b22a
commit
eccc3c3ef0
1 changed files with 4 additions and 0 deletions
|
@ -50,6 +50,10 @@ WSClientConnection::WSClientConnection(CLocalSocket& client_socket, int client_i
|
|||
|
||||
WSClientConnection::~WSClientConnection()
|
||||
{
|
||||
// NOTE: Move the windows out of 'm_windows' before teardown. This prevents code
|
||||
// that runs in response to window destruction from trying to iterate over
|
||||
// a partially destroyed window list.
|
||||
auto windows = move(m_windows);
|
||||
s_connections->remove(client_id());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue