1
0
Fork 0
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:
Andreas Kling 2025-05-28 11:11:12 +02:00 committed by Alexander Kalenik
parent c2c9348636
commit e0e09f71be
Notes: github-actions[bot] 2025-05-29 01:48:49 +00:00

View file

@ -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);
}); });
} }