Add g_autofree
authorColin Walters <walters@verbum.org>
Sun, 15 Feb 2015 13:58:44 +0000 (08:58 -0500)
committerColin Walters <walters@verbum.org>
Mon, 23 Feb 2015 03:18:07 +0000 (22:18 -0500)
commitd0105f1c0845c1244c8419d0bb24c6f64ac9015f
tree296bcf9287ff07ba35c1dff0d4c1a873a80f9bc4
parent2844f239f60cab6e549102d7cdc3cf0333076cbe
Add g_autofree

The g_autoptr() being associated with the type name works out really
well for things like GHashTable.  However, it's a bit more awkward to
associate with "gchar".  Also because one can't use "char".
Similarly, there are a lot of other "bare primitive array" types that
one might reasonably use.

This patch does not remove the autoptr for "gchar", even though I
think it's rather awkward and strange.

Also while we're here, add a test case for the cleanup bits.

https://bugzilla.gnome.org/show_bug.cgi?id=744747
glib/docs.c
glib/glib-autocleanups.h
glib/gmacros.h
glib/tests/Makefile.am
glib/tests/autoptr.c [new file with mode: 0644]