After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 567078 - Don't keep an extra reference to closures
Don't keep an extra reference to closures
Status: RESOLVED FIXED
Product: gjs
Classification: Bindings
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2009-01-08 21:15 UTC by Owen Taylor
Modified: 2009-01-08 21:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't keep an extra reference to closures (2.63 KB, patch)
2009-01-08 21:15 UTC, Owen Taylor
accepted-commit_now Details | Review

Description Owen Taylor 2009-01-08 21:15:44 UTC
There's no need to hold an extra reference to closures ourselves; the
user of the closure (the signal system say), will keep the closure
referenced as long as it can be invoked.

Since invalidation notifiers are typically only called when the closure
is finalized, this was causing almost all closures (and the referenced
JS objects) to be leaked, since a referenced closure would never be
finalized or invalidated.
Comment 1 Owen Taylor 2009-01-08 21:15:48 UTC
Created attachment 126055 [details] [review]
Don't keep an extra reference to closures
Comment 2 Owen Taylor 2009-01-08 21:32:52 UTC
Committed, thanks.