Fix memory leak in template signal handlers
Fixes #576 (closed).
- Added support for passing boxed closures to GI.
- Added a new system function,
associateClosure
, which takes an object and a JavaScript function and returns a boxed closure that is bound to the object's lifetime using the existingObjectInstance::associate_closure
mechanism. - Similarly, added
Object.connect_object
which takes a function and an object, and binds the closure to the object's lifetime. - Changed the Gtk template override to associate signal handler closures to the lifetime of the current object, matching the behavior of templates in C.
- Added a test to ensure the template is not leaked.
See the issue and the commit messages for more details.