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:
Andreas Kling 2019-09-21 18:05:34 +02:00
parent 0c4508c00d
commit 4d8455156e
Notes: sideshowbarker 2024-07-19 12:01:36 +09:00

View file

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