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

Improve overlapped deallocation strategy and docs #1042

Merged
merged 2 commits into from
Aug 7, 2019
Merged

Improve overlapped deallocation strategy and docs #1042

merged 2 commits into from
Aug 7, 2019

Conversation

PerfectLaugh
Copy link
Contributor

This should solve the error return memory leak.

@PerfectLaugh PerfectLaugh mentioned this pull request Jul 19, 2019
16 tasks
@carllerche
Copy link
Member

Thanks for following up. Is there a way to add a test that covers the leak?

@PerfectLaugh
Copy link
Contributor Author

I don't know how to write a test for that.
But you just have to deallocate the overlapped pointer if you have error on Afd driver poll. Even when the operation is cancelled, the overlapped will be used by IOCP with cancelled status.

@PerfectLaugh
Copy link
Contributor Author

and I have confirmed that double free is occurred when cancel without forgetting overlapped.

@Thomasdezeeuw
Copy link
Collaborator

@carllerche is this good to merge?

Copy link
Member

@carllerche carllerche left a comment

Choose a reason for hiding this comment

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

👍 Thanks

@carllerche carllerche merged commit 211223e into tokio-rs:master Aug 7, 2019
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.

3 participants