Skip to content
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

Example possibly not accurate? #48

Open
ConfidantCommunications opened this issue May 5, 2023 · 1 comment
Open

Example possibly not accurate? #48

ConfidantCommunications opened this issue May 5, 2023 · 1 comment

Comments

@ConfidantCommunications
Copy link
Contributor

ConfidantCommunications commented May 5, 2023

https://github.com/haxetink/tink_io/blob/gh-pages/README.md#memory-management

It seems the example code here is unfinished by accident. Or does the trace statement actually interfere with the garbage collection?

@ConfidantCommunications ConfidantCommunications changed the title Example not accurate Example possibly not accurate? May 5, 2023
@back2dos
Copy link
Member

back2dos commented May 6, 2023

It's complete, although maybe unclear. It's not the trace statement per se, but rather the fact that the handler captures a reference to the source, thereby delaying GC until the callback has fired.

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

No branches or pull requests

2 participants