The CurlAsyncHTTPClient will cause memory leak when set `force_instance=True`,
because the `self._multi` and `self._force_timeout_callback` hold some methods
that belong the instance of `CurlAsyncHTTPClient`, it will cause circular reference.
self._multi.close()
super(CurlAsyncHTTPClient, self).close()
+ # Set below properties to None to reduce the reference count of current
+ # instance, because those properties hold some methods of current
+ # instance that will case circular reference.
+ self._force_timeout_callback = None
+ self._multi = None
+
def fetch_impl(self, request, callback):
self._requests.append((request, callback))
self._process_queue()