Skip to content

Fix ref cycles in callback handles #225

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 2 commits into from
Feb 11, 2019
Merged

Fix ref cycles in callback handles #225

merged 2 commits into from
Feb 11, 2019

Conversation

1st1
Copy link
Member

@1st1 1st1 commented Feb 11, 2019

No description provided.

@1st1
Copy link
Member Author

1st1 commented Feb 11, 2019

@fantix please take a look

Copy link
Member

@fantix fantix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the fix!

1st1 added 2 commits February 11, 2019 17:17
Currently there's a lot of potential to create reference cycles
between callback handles and protocols/transports that use them.
Basically any bound-method has a potential to create such a cycle.
This happens especially often for TimerHandles used to ensure
timeouts.

Fix that by ensuring that the handle clears the ref to its callback
when the 'cancel()' method is called.
@fantix fantix mentioned this pull request Feb 11, 2019
4 tasks
@1st1 1st1 merged commit 34b7320 into master Feb 11, 2019
@1st1 1st1 deleted the callback branch February 11, 2019 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants