mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-05 00:56:39 +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
Notes:
sideshowbarker
2024-07-18 12:26:58 +09:00
Author: https://github.com/MaxWipfli
Commit: 6e6ff844d3
Pull-request: https://github.com/SerenityOS/serenity/pull/7879
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/gunnarbeutner
Reviewed-by: https://github.com/linusg
Reviewed-by: https://github.com/stelar7
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()
|
||||||
{
|
{
|
||||||
|
deferred_invoke([this](auto& object) {
|
||||||
|
NonnullRefPtr protector { object };
|
||||||
remove_from_parent();
|
remove_from_parent();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::start()
|
void Client::start()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue