1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:37:37 +00:00

LibHTTP: Null out on_ready_to_read on socket close

This fixes the segfault reported in #15283.

on_ready_to_read gets re-registered on every job start anyways.
I see no reason why this could be bad.
This commit is contained in:
Enver Balalic 2022-09-26 20:09:38 +02:00 committed by Andreas Kling
parent 3cf6ac1b3f
commit 55c099c953

View file

@ -127,6 +127,7 @@ void Job::shutdown(ShutdownMode mode)
return;
if (mode == ShutdownMode::CloseSocket) {
m_socket->close();
m_socket->on_ready_to_read = nullptr;
} else {
m_socket->on_ready_to_read = nullptr;
m_socket = nullptr;