mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
CHttpJob: Shutting down the job should actually destroy the socket
It's pretty confusing when a CObject is owned both by its parent-child relationship, but also by an ObjectPtr member in the parent. In those cases, we have to make sure we both unparent the child *and* reove it from the ObjectPtr. This will become a bit less confusing when ObjectPtr becomes RefPtr, although still not crystal clear. I'm not sure what the solution is.
This commit is contained in:
parent
0c4508c00d
commit
4d8455156e
Notes:
sideshowbarker
2024-07-19 12:01:36 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/4d8455156ef
1 changed files with 2 additions and 0 deletions
|
@ -134,5 +134,7 @@ void CHttpJob::shutdown()
|
|||
return;
|
||||
m_socket->on_ready_to_read = nullptr;
|
||||
m_socket->on_connected = nullptr;
|
||||
remove_child(*m_socket);
|
||||
m_socket = nullptr;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue