Bläddra i källkod

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.
Andreas Kling 5 år sedan
förälder
incheckning
4d8455156e
1 ändrade filer med 2 tillägg och 0 borttagningar
  1. 2 0
      Libraries/LibCore/CHttpJob.cpp

+ 2 - 0
Libraries/LibCore/CHttpJob.cpp

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