فهرست منبع

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 سال پیش
والد
کامیت
4d8455156e
1فایلهای تغییر یافته به همراه2 افزوده شده و 0 حذف شده
  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;
 }
+