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 711778 - Implement GCleanup in libgobject
Implement GCleanup in libgobject
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: gobject
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on: 711779 711782
Blocks: 627423
 
 
Reported: 2013-11-10 14:47 UTC by Stef Walter
Modified: 2018-05-24 15:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gobject: Define a cleanup scope for libgobject (970 bytes, patch)
2013-11-10 15:07 UTC, Stef Walter
none Details | Review
gatomicarray: Support for cleaning up (2.66 KB, patch)
2013-11-10 15:08 UTC, Stef Walter
none Details | Review
gtype: add g_type_set_qdata_full (5.69 KB, patch)
2013-11-10 15:08 UTC, Stef Walter
none Details | Review
gtype: Implement cleanup of GType (8.54 KB, patch)
2013-11-10 15:09 UTC, Stef Walter
none Details | Review
gtype: Push registered GType onto the appropriate cleanup list (25.41 KB, patch)
2013-11-10 15:09 UTC, Stef Walter
none Details | Review
gobject: Cleanup GObject class stuff (6.13 KB, patch)
2013-11-10 15:10 UTC, Stef Walter
none Details | Review
gparam: Reliably free class info initialization closure (1.20 KB, patch)
2013-11-10 15:10 UTC, Stef Walter
none Details | Review
gtype: Remove unneeded ref of static parent type (824 bytes, patch)
2013-11-10 15:10 UTC, Stef Walter
none Details | Review
gtypemodule: Allow GTypeModule to be finalized (1.98 KB, patch)
2013-11-10 15:11 UTC, Stef Walter
none Details | Review
gvalue: Cleanup global static data (904 bytes, patch)
2013-11-10 15:12 UTC, Stef Walter
none Details | Review
gobject: Don't leak pspecs for ininstantiated interfaces (2.53 KB, patch)
2013-11-10 15:13 UTC, Stef Walter
none Details | Review
tests/gobject: Use cleanup for types defined in tests (2.71 KB, patch)
2013-11-10 15:15 UTC, Stef Walter
none Details | Review
gio: Define cleanup scope and list for libgio (1.98 KB, patch)
2013-11-10 20:53 UTC, Stef Walter
none Details | Review
gdbus: Cleanup global static data (1.97 KB, patch)
2013-11-10 20:53 UTC, Stef Walter
none Details | Review
gioenumtypes: Push enum GTypes onto cleanup list (809 bytes, patch)
2013-11-10 20:54 UTC, Stef Walter
none Details | Review
dynamictype: Fix leak in test (966 bytes, patch)
2013-11-11 07:25 UTC, Stef Walter
none Details | Review
param: Avoid g_test_add_data_func_full() which leaks (1.16 KB, patch)
2013-11-11 07:25 UTC, Stef Walter
none Details | Review

Description Stef Walter 2013-11-10 14:47:47 UTC
Implement cleanup in libgmodule and associated tests.

I've split this out from bug #627423 for simplicity, since there are quite a
few patches. That should make it easier to review, track dependencies and so
on.

Goal here is to have all gobject related tests running without leaks or memory
issues.
Comment 1 Stef Walter 2013-11-10 14:49:17 UTC
Er, this is about libgobject. Disregard typo above.
Comment 2 Stef Walter 2013-11-10 15:07:18 UTC
Created attachment 259424 [details] [review]
gobject: Define a cleanup scope for libgobject
Comment 3 Stef Walter 2013-11-10 15:08:13 UTC
Created attachment 259425 [details] [review]
gatomicarray: Support for cleaning up

Cleanup atomic array manually as very last thing
Otherwise we keep putting stuff in freelist during cleanup.

Initial work by: Dan Winship <danw@gnome.org>
Comment 4 Stef Walter 2013-11-10 15:08:43 UTC
Created attachment 259426 [details] [review]
gtype: add g_type_set_qdata_full

Tweaked by: Stef Walter <stefw@redhat.com>
Comment 5 Stef Walter 2013-11-10 15:09:07 UTC
Created attachment 259427 [details] [review]
gtype: Implement cleanup of GType

Partially from patches from Ole André Vadla Ravnås, and Dan Winship

There are a lot of intertwined pointer references between
types, their vtables, and other bits. Free the memory for them
all together.

Note that we still do all finalization (ie: callbacks) per type
and module, in the relevant cleanup lists.
Comment 6 Stef Walter 2013-11-10 15:09:40 UTC
Created attachment 259428 [details] [review]
gtype: Push registered GType onto the appropriate cleanup list

When G_CLEANUP_SCOPE is defined the G_DEFINE_TYPE and macros
properly push newly registered GTypes onto the cleanup list.

In addition push all the the basic types into the libgobject
cleanup list.
Comment 7 Stef Walter 2013-11-10 15:10:12 UTC
Created attachment 259429 [details] [review]
gobject: Cleanup GObject class stuff

Initial work by: Dan Winship <danw@gnome.org>
Comment 8 Stef Walter 2013-11-10 15:10:33 UTC
Created attachment 259430 [details] [review]
gparam: Reliably free class info initialization closure

Otherwise we end up in a strange leak where static types leak
unless their class has been ref'd.
Comment 9 Stef Walter 2013-11-10 15:10:59 UTC
Created attachment 259431 [details] [review]
gtype: Remove unneeded ref of static parent type

This causes a leak of the parent type.
Comment 10 Stef Walter 2013-11-10 15:11:26 UTC
Created attachment 259432 [details] [review]
gtypemodule: Allow GTypeModule to be finalized

This is used by the cleanup code.
Comment 11 Stef Walter 2013-11-10 15:12:00 UTC
Created attachment 259433 [details] [review]
gvalue: Cleanup global static data
Comment 12 Stef Walter 2013-11-10 15:13:28 UTC
Created attachment 259436 [details] [review]
gobject: Don't leak pspecs for ininstantiated interfaces

Remove the awkward ownerhsip of pspec by the object. pspecs are
now only owned by the pool, which makes things more predictable.
Comment 13 Stef Walter 2013-11-10 15:15:08 UTC
Created attachment 259446 [details] [review]
tests/gobject: Use cleanup for types defined in tests
Comment 14 Stef Walter 2013-11-10 20:53:09 UTC
Created attachment 259461 [details] [review]
gio: Define cleanup scope and list for libgio
Comment 15 Stef Walter 2013-11-10 20:53:55 UTC
Created attachment 259462 [details] [review]
gdbus: Cleanup global static data
Comment 16 Stef Walter 2013-11-10 20:54:01 UTC
Created attachment 259463 [details] [review]
gioenumtypes: Push enum GTypes onto cleanup list
Comment 17 Stef Walter 2013-11-11 07:25:06 UTC
Created attachment 259527 [details] [review]
dynamictype: Fix leak in test
Comment 18 Stef Walter 2013-11-11 07:25:22 UTC
Created attachment 259529 [details] [review]
param: Avoid g_test_add_data_func_full() which leaks

It leaks on tests that have not been run. This is the case when
the g_test_subprocess mechanics are in use.
Comment 19 GNOME Infrastructure Team 2018-05-24 15:54:15 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/glib/issues/782.