Commit Graph

14397 Commits

Author SHA1 Message Date
Stef Walter
b96349d30f gdbusintrospection: Free up cache when done with it
https://bugzilla.gnome.org/show_bug.cgi?id=711799
2013-11-13 12:59:40 +01:00
Stef Walter
a0beb13d80 gdbus-connection: Fix race condition in test
The test was expecting that the spawned process wouldn't start
up before the NameOwnerChanged signal was subscribed.

https://bugzilla.gnome.org/show_bug.cgi?id=711805
2013-11-13 12:59:40 +01:00
Stef Walter
885e4429bf gdbusconnection: Fix invalid memory access
Occurs when the string is zero length.

https://bugzilla.gnome.org/show_bug.cgi?id=711804
2013-11-13 12:59:40 +01:00
Stef Walter
daa6d34e46 gsubprocess: Cleanup GSubprocess correctly
Although it's nice that GSubprocess object lives until its
child goes away, this can't be the case during cleanup and or
unloading of gio, since the GLib worker thread will run non-existant
code.

So in the case that GIO hits cleanup, we finalize the GSubprocess
regardless of the state of its child.

https://bugzilla.gnome.org/show_bug.cgi?id=711799
2013-11-13 12:59:40 +01:00
Stef Walter
3e7a2cfda3 gio: Define cleanup scope and lists for gio tests
https://bugzilla.gnome.org/show_bug.cgi?id=711799
2013-11-13 12:59:39 +01:00
Stef Walter
ced68f1587 filter-streams: Cleanup custom classes in test
https://bugzilla.gnome.org/show_bug.cgi?id=711799
2013-11-13 12:59:39 +01:00
Stef Walter
fb8557bdfc gio/tests: Prevent random gio modules from screwing up these tests
https://bugzilla.gnome.org/show_bug.cgi?id=711799
2013-11-13 12:59:39 +01:00
Stef Walter
f5c743c939 gfileinfo: Cleanup memory
https://bugzilla.gnome.org/show_bug.cgi?id=711799
2013-11-13 12:59:39 +01:00
Stef Walter
716068850d gcancellable: Free up GPrivate in right cleanup context
https://bugzilla.gnome.org/show_bug.cgi?id=711799
2013-11-13 12:59:39 +01:00
Stef Walter
5da529ae0f gtask: Cleanup thread pool
https://bugzilla.gnome.org/show_bug.cgi?id=711799
2013-11-13 12:59:39 +01:00
Stef Walter
c654161f03 gsocketconnection: Cleanup global data
https://bugzilla.gnome.org/show_bug.cgi?id=711799
2013-11-13 12:59:39 +01:00
Stef Walter
e53479cf7c gresolver: Cleanup global data
https://bugzilla.gnome.org/show_bug.cgi?id=711799
2013-11-13 12:59:39 +01:00
Stef Walter
c7144072c3 glocalfile: Cleanup global data
https://bugzilla.gnome.org/show_bug.cgi?id=711799
2013-11-13 12:59:39 +01:00
Stef Walter
f741871031 giomodule: Allow overriding source directory gio modules are loaded from
When testing (and valgrinding) we need to have a known set of modules
loaded.

https://bugzilla.gnome.org/show_bug.cgi?id=711801
2013-11-13 12:59:38 +01:00
Stef Walter
812320d46a giomodule: Cleanup global data
https://bugzilla.gnome.org/show_bug.cgi?id=711799
2013-11-13 12:59:38 +01:00
Stef Walter
a95b8d5ebf gioenumtypes: Push enum GTypes onto cleanup list
https://bugzilla.gnome.org/show_bug.cgi?id=711799
2013-11-13 12:59:38 +01:00
Stef Walter
f4bc304e5c gdbus: Cleanup global static data
https://bugzilla.gnome.org/show_bug.cgi?id=711799
2013-11-13 12:59:38 +01:00
Stef Walter
6cc9926a1e gio: Define cleanup scope and list for libgio
https://bugzilla.gnome.org/show_bug.cgi?id=711799
2013-11-13 12:59:38 +01:00
Stef Walter
822c22ba39 tests/gobject: Use cleanup for types defined in tests
https://bugzilla.gnome.org/show_bug.cgi?id=711778
2013-11-13 12:59:38 +01:00
Stef Walter
3071adddaf dynamictype: Fix leak in test
https://bugzilla.gnome.org/show_bug.cgi?id=711778
2013-11-13 12:59:38 +01:00
Stef Walter
15240b8500 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.

https://bugzilla.gnome.org/show_bug.cgi?id=711778
2013-11-13 12:59:38 +01:00
Stef Walter
faa42f57f1 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.

https://bugzilla.gnome.org/show_bug.cgi?id=711778
2013-11-13 12:59:37 +01:00
Stef Walter
806868941d gvalue: Cleanup global static data
https://bugzilla.gnome.org/show_bug.cgi?id=711778
2013-11-13 12:59:37 +01:00
Stef Walter
df5732fa52 gtypemodule: Allow GTypeModule to be finalized
This is used by the cleanup code.

https://bugzilla.gnome.org/show_bug.cgi?id=711778
2013-11-13 12:59:37 +01:00
Stef Walter
3c0be72a90 gtype: Remove unneeded ref of static parent type
This causes a leak of the parent type.

https://bugzilla.gnome.org/show_bug.cgi?id=711778
2013-11-13 12:59:37 +01:00
Stef Walter
9fb815c000 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.

https://bugzilla.gnome.org/show_bug.cgi?id=711778
2013-11-13 12:59:37 +01:00
Stef Walter
f79499db95 gobject: Cleanup GObject class stuff
Initial work by: Dan Winship <danw@gnome.org>

https://bugzilla.gnome.org/show_bug.cgi?id=711778
2013-11-13 12:59:37 +01:00
Stef Walter
0922afeb2a 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.

https://bugzilla.gnome.org/show_bug.cgi?id=711778
2013-11-13 12:59:37 +01:00
Stef Walter
4ffc3fd656 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.

https://bugzilla.gnome.org/show_bug.cgi?id=711778
2013-11-13 12:59:35 +01:00
Stef Walter
b33fabd585 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>

https://bugzilla.gnome.org/show_bug.cgi?id=711778
2013-11-13 09:45:55 +01:00
Stef Walter
11dc3eedb5 gobject: Define a cleanup scope for libgobject
https://bugzilla.gnome.org/show_bug.cgi?id=711778
2013-11-13 09:45:16 +01:00
Stef Walter
b32ca195a6 gmodule: Cleanup main_module, ie: self
https://bugzilla.gnome.org/show_bug.cgi?id=711767
2013-11-13 09:45:14 +01:00
Stef Walter
c9d6518969 gthreadpool: Cleanup thread pool unused threads
This requires different phases getting involved:
 * early: Signal all the unused pool threads, and change unused
   limits to zero, so no new unused pool threads.
 * default: Join all unused pool threads.
 * late: Free up the unused thread queue

https://bugzilla.gnome.org/show_bug.cgi?id=711744
2013-11-13 09:44:21 +01:00
Stef Walter
2361bf79ca threadpool-test: Cleanup memory in test
https://bugzilla.gnome.org/show_bug.cgi?id=711744
2013-11-13 09:42:26 +01:00
Stef Walter
11394e78bb sources: Fix leaks in tests
https://bugzilla.gnome.org/show_bug.cgi?id=711751
2013-11-13 09:40:31 +01:00
Stef Walter
26d7b74e51 slice: Don't run GSlice tests under valgrind
https://bugzilla.gnome.org/show_bug.cgi?id=711744
2013-11-13 09:40:25 +01:00
Stef Walter
44c5542eab 642026: Run less locking iterations under valgrind
Otherwise these tests are prohibitively slow.  Under valgrind the
same race conditions aren't likely to show up anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=711744
2013-11-13 09:40:19 +01:00
Stef Walter
21698230c3 gmessages: Initialize GPrivate so it gets cleaned up
https://bugzilla.gnome.org/show_bug.cgi?id=711744
2013-11-13 09:40:18 +01:00
Stef Walter
425d7b7fae gcleanup: Hook up more libglib globals to cleanup
https://bugzilla.gnome.org/show_bug.cgi?id=711744
2013-11-13 09:38:53 +01:00
Stef Walter
75a458a9b4 glib: Define cleanup lists for glib tests
This allows G_CLEANUP to be used in the tests, and from things
like G_PRIVATE_INIT and so on.

https://bugzilla.gnome.org/show_bug.cgi?id=711744
2013-11-13 09:36:01 +01:00
Stef Walter
530f4930bf option-context: Fix leaks in tests
https://bugzilla.gnome.org/show_bug.cgi?id=627423
2013-11-13 09:35:47 +01:00
Stef Walter
d7987752a5 gcleanup: Add in more gtestutils.c cleanups
https://bugzilla.gnome.org/show_bug.cgi?id=711744
2013-11-13 09:34:48 +01:00
Ryan Lortie
9b6678b866 GThread posix: add impl structs to cleanup list
There are two ways of using the structs like GMutex, GCond, etc.

The first is to explicitly _init() and _clear() them.  This is when you
use them as part of another structure.  This case is not interesting for
gcleanup.

The other is to have them in static storage (zero-filled) and just use
them for the first time.  This is the difficult case, because we don't
ever free the impl in that case.

In the first case, the impl is created and set in the _init() function.
We can therfore tell that we are in the second case if we get to the
get_impl() function and the impl is not there yet.  In that case, add it
to the cleanup list.

There are probably people that allocate a GMutex as part of a
zero-filled structure and use it, then call g_mutex_clear() on it.  This
is technically a violation of the API and these users will crash with
G_DEBUG=cleanup, but that's a good thing because it will cause them to
fix their code.

All threading primitives are cleaned up on the graveyard shift, so that
they can be used by other cleanup functions is libglib.

Because GPrivate has a callback, and we need to run that callback for
the main thread, we schedule two cleanups for it. The cleanup needs
to run in the cleanup scope where the GPrivate callback is defined,
so adapt G_PRIVATE_INIT to do this.

Tweaked by: Stef Walter <stefw@redhat.com>

https://bugzilla.gnome.org/show_bug.cgi?id=711744
2013-11-13 09:34:35 +01:00
Stef Walter
d7747a1454 gthread-posix: Don't use gslice allocated GRecMutex
This leads to problems during cleanup, and seems strange
to have locks defined in terms of things that need locking.

https://bugzilla.gnome.org/show_bug.cgi?id=711753
2013-11-13 09:26:05 +01:00
Stef Walter
b9c11b1a85 memcheck: Add a 'make memcheck' target that runs valgrind
Checks for memory errors and leaks

https://bugzilla.gnome.org/show_bug.cgi?id=711744
2013-11-13 09:25:18 +01:00
Ryan Lortie
fc1a1cd681 Make some use of G_CLEANUP
This is enough to get a few testcases running with zero memory in use at
the end.

Tweaked by: Stef Walter <stefw@redhat.com>

https://bugzilla.gnome.org/show_bug.cgi?id=711744
2013-11-13 09:24:59 +01:00
Stef Walter
6f5c379d59 WIP cleanup for qdata 2013-11-13 09:19:35 +01:00
Stef Walter
81a2133a72 gcleanup: Implementation of GCleanupScope and associated macros
Add a new type GCleanupScope that stores a list of things to "clean up"
when g_cleanup_clean() is called.

More importantly, define some macros (G_CLEANUP, etc) that
facilitate conditionally building a per-library/executable cleanup list
if G_DEBUG=cleanup is specified.  The cleanup list is run at destructor
time.

-DG_CLEANUP_SCOPE defines the name of the cleanup list and enables the
feature for a given module.

Concept and initial work: Ryan Lortie <desrt@desrt.ca>

https://bugzilla.gnome.org/show_bug.cgi?id=627423
2013-11-13 09:19:28 +01:00
Ryan Lortie
21cf219cf6 gconstructor: install as a proper header
https://bugzilla.gnome.org/show_bug.cgi?id=627423
2013-11-12 20:54:10 +01:00
Ryan Lortie
d33f758313 bump version 2013-11-12 00:19:50 -05:00