Skip to content

Fix leak in complete() callback of Database.each() #307

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
Aug 6, 2014
Merged

Fix leak in complete() callback of Database.each() #307

merged 1 commit into from
Aug 6, 2014

Conversation

thierer
Copy link
Contributor

@thierer thierer commented Jun 20, 2014

Add destructor to EachBaton that disposes the completed callback function.

Fixes #297.

I didn't implement the part of my previous patch that prevented the duplication of the callback handles in Statement::Work_BeginEach because 1. it's not strictly necessary and 2. I don't understand enough of this nan stuff to be confident to do it right.

I've checked (using node v0.10.22) that 1. the memory leak still exists in current HEAD and 2. this patch fixes it.

Add destructor to EachBaton that disposes the `completed` callback function.
@springmeyer
Copy link
Contributor

Thank you!

@springmeyer
Copy link
Contributor

Was able to replicate and confirm this fixes - great work, will push out release next so that this will be included in the upcoming v2.2.5

springmeyer pushed a commit that referenced this pull request Aug 6, 2014
Fix leak in complete() callback of Database.each()
@springmeyer springmeyer merged commit 72c51aa into TryGhost:master Aug 6, 2014
@thierer
Copy link
Contributor Author

thierer commented Aug 8, 2014

Thanks!

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.

"complete" callback of Database.each() leaking memory?
2 participants