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 584047 - Use cleanup list to release allocated arguments.
Use cleanup list to release allocated arguments.
Status: RESOLVED OBSOLETE
Product: gjs
Classification: Bindings
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks: 582228
 
 
Reported: 2009-05-27 20:08 UTC by C. Scott Ananian
Modified: 2018-01-27 11:43 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description C. Scott Ananian 2009-05-27 20:08:39 UTC
Initially discussed in the comments to bug 582228.

To properly support TRANSFER_CONTAINER and bare C arrays-of-(objects), we should refactor the release code to implement a post-invocation cleanup list.  Cleanups are something like:

struct _Cleanup {
   enum { CLEANUP_G_FREE, CLEANUP_G_OBJECT_UNREF, CLEANUP_GI_TYPE, ... } type;
   gpointer data;
}

The CLEANUP_GI_TYPE argument uses the existing GI type-driven release method, since that is necessary in any case to release TRANSFER_EVERYTHING out-parameters.

When marshaling container types from JavaScript to C, we can add cleanups for the contained objects (unless TRANSFER_CONTAINER or TRANSFER_NONE) as we add them to the container and then add a clean up for the container (unless TRANSFER_NONE).
Comment 1 Johan Bilien 2009-06-16 14:22:15 UTC
Should the first element be a GDestroyNotify instead of the enum?
Comment 2 GNOME Infrastructure Team 2018-01-27 11:43:14 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gjs/issues/44.