[glib] gobject: Add g_autoptr() support for GParamSpec



commit cdfc79aae9d4c123ab15fea9cf1e4429f15aba66
Author: Philip Withnall <withnall endlessm com>
Date:   Tue May 15 15:30:01 2018 +0100

    gobject: Add g_autoptr() support for GParamSpec
    
    Do not add support for its subtypes, since all their constructors return
    GParamSpec*, and g_param_spec_unref() takes a GParamSpec* rather than a
    gpointer — adding G_DEFINE_AUTOPTR_CLEANUP_FUNC() for subtypes of
    GParamSpec results in compiler warnings about mismatched parameter
    types (GParamSpecBoolean* vs GParamSpec*, for example).
    
    Signed-off-by: Philip Withnall <withnall endlessm com>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=796139

 gobject/gobject-autocleanups.h | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/gobject/gobject-autocleanups.h b/gobject/gobject-autocleanups.h
index 8aeda2eb9..cc353bf9a 100644
--- a/gobject/gobject-autocleanups.h
+++ b/gobject/gobject-autocleanups.h
@@ -24,4 +24,5 @@
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GClosure, g_closure_unref)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GObject, g_object_unref)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GInitiallyUnowned, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GParamSpec, g_param_spec_unref)
 G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GValue, g_value_unset)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]