Skip to content

Fix memory leaks in greengrasscoreipc #186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions awsiot/eventstreamrpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,8 +611,8 @@ def __init__(self, stream_handler: StreamResponseHandler, shape_index: ShapeInde
self._closed_future.set_running_or_notify_cancel() # prevent cancel
self._initial_response_future = Future()
self._initial_response_future.set_running_or_notify_cancel() # prevent cancel
self._protocol_handler = _ProtocolContinuationHandler(self)
self._continuation = connection._new_stream(self._protocol_handler)
protocol_handler = _ProtocolContinuationHandler(self)
self._continuation = connection._new_stream(protocol_handler)

def _activate(self, request: Shape) -> Future:
headers = [Header.from_string(CONTENT_TYPE_HEADER,
Expand Down Expand Up @@ -805,6 +805,9 @@ def on_continuation_message(self, *args, **kwargs):

def on_continuation_closed(self, *args, **kwargs):
self.operation._on_continuation_closed(*args, **kwargs)
# break circular reference between: ClientOperation, _ProtocolContinuationHandler, ClientContinuation
# so that garbage collector can clean them up
self.operation = None


class Client:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"Operating System :: OS Independent",
],
install_requires=[
'awscrt==0.11.8',
'awscrt==0.11.12',
],
python_requires='>=3.5',
)