mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-08 05:27:14 +09:00
RequestServer: Don't try to self-destruct already-destroyed request
This commit is contained in:
parent
c2c9348636
commit
e0e09f71be
Notes:
github-actions[bot]
2025-05-29 01:48:49 +00:00
Author: https://github.com/awesomekling
Commit: e0e09f71be
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4899
Reviewed-by: https://github.com/Hendiadyoin1
Reviewed-by: https://github.com/shannonbooth
1 changed files with 6 additions and 4 deletions
|
@ -99,7 +99,7 @@ ByteString build_curl_resolve_list(DNS::LookupResult const& dns_result, StringVi
|
||||||
return resolve_opt_builder.to_byte_string();
|
return resolve_opt_builder.to_byte_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ConnectionFromClient::ActiveRequest {
|
struct ConnectionFromClient::ActiveRequest : public Weakable<ActiveRequest> {
|
||||||
CURLM* multi { nullptr };
|
CURLM* multi { nullptr };
|
||||||
CURL* easy { nullptr };
|
CURL* easy { nullptr };
|
||||||
Vector<curl_slist*> curl_string_lists;
|
Vector<curl_slist*> curl_string_lists;
|
||||||
|
@ -133,9 +133,11 @@ struct ConnectionFromClient::ActiveRequest {
|
||||||
|
|
||||||
void schedule_self_destruction() const
|
void schedule_self_destruction() const
|
||||||
{
|
{
|
||||||
Core::deferred_invoke([this] {
|
Core::deferred_invoke([weak_this = make_weak_ptr()] {
|
||||||
if (client)
|
if (!weak_this)
|
||||||
client->m_active_requests.remove(request_id);
|
return;
|
||||||
|
if (weak_this->client)
|
||||||
|
weak_this->client->m_active_requests.remove(weak_this->request_id);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue