mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:17:34 +00:00
WebServer: Defer invocation of Client::remove_from_parent()
This is necessary to avoid trying to destruct the on_ready_to_read function from inside the function. This fixes #7810.
This commit is contained in:
parent
5408111aff
commit
6e6ff844d3
1 changed files with 5 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
||||||
|
* Copyright (c) 2021, Max Wipfli <mail@maxwipfli.ch>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
@ -33,7 +34,10 @@ Client::Client(NonnullRefPtr<Core::TCPSocket> socket, String const& root, Core::
|
||||||
|
|
||||||
void Client::die()
|
void Client::die()
|
||||||
{
|
{
|
||||||
remove_from_parent();
|
deferred_invoke([this](auto& object) {
|
||||||
|
NonnullRefPtr protector { object };
|
||||||
|
remove_from_parent();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::start()
|
void Client::start()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue