Fix memory leak in _DynamicCapabilityClient._send_helper() (#398)
The heap-allocated Request object was never freed after send(). Each RPC call leaked ~72 bytes, growing linearly with usage. Added del request after request.send() to free the Request once the RemotePromise has been constructed.
This commit is contained in:
@@ -2320,7 +2320,9 @@ cdef class _DynamicCapabilityClient:
|
||||
|
||||
self._set_fields(request, name, args, kwargs)
|
||||
|
||||
return _RemotePromise()._init(request.send(), self)
|
||||
cdef _RemotePromise result = _RemotePromise()._init(request.send(), self)
|
||||
del request
|
||||
return result
|
||||
|
||||
cpdef _request_helper(self, name, firstSegmentWordSize, args, kwargs):
|
||||
# if word_count is None:
|
||||
|
||||
Reference in New Issue
Block a user