mapbox/node-sqlite3 — pull request #307 by thierer (2014-06-20 19:52:21+00:00)
Title: Fix leak in complete() callback of Database.each()

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.