[geocode-glib] geocode-glib: Add g_autoptr() cleanup functions



commit 71154cd6866d038725376e51a17cb70d0d0f402a
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Thu Oct 13 11:53:14 2016 +0100

    geocode-glib: Add g_autoptr() cleanup functions
    
    This allows us to use GeocodeForward and GeocodeReverse with
    g_autoptr().
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756311

 geocode-glib/geocode-bounding-box.h |    2 ++
 geocode-glib/geocode-forward.h      |    2 ++
 geocode-glib/geocode-location.h     |    2 ++
 geocode-glib/geocode-place.h        |    2 ++
 geocode-glib/geocode-reverse.h      |    2 ++
 5 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/geocode-glib/geocode-bounding-box.h b/geocode-glib/geocode-bounding-box.h
index 5de55ea..8cc43b6 100644
--- a/geocode-glib/geocode-bounding-box.h
+++ b/geocode-glib/geocode-bounding-box.h
@@ -64,6 +64,8 @@ struct _GeocodeBoundingBoxClass {
         GObjectClass parent_class;
 };
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeocodeBoundingBox, g_object_unref)
+
 GeocodeBoundingBox *geocode_bounding_box_new  (gdouble top,
                                                gdouble bottom,
                                                gdouble left,
diff --git a/geocode-glib/geocode-forward.h b/geocode-glib/geocode-forward.h
index ff175ca..59924be 100644
--- a/geocode-glib/geocode-forward.h
+++ b/geocode-glib/geocode-forward.h
@@ -64,6 +64,8 @@ struct _GeocodeForwardClass {
        GObjectClass parent_class;
 };
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeocodeForward, g_object_unref)
+
 GeocodeForward *geocode_forward_new_for_string       (const char *str);
 GeocodeForward *geocode_forward_new_for_params       (GHashTable *params);
 guint geocode_forward_get_answer_count               (GeocodeForward *forward);
diff --git a/geocode-glib/geocode-location.h b/geocode-glib/geocode-location.h
index 701270d..4805814 100644
--- a/geocode-glib/geocode-location.h
+++ b/geocode-glib/geocode-location.h
@@ -62,6 +62,8 @@ struct _GeocodeLocationClass {
         GObjectClass parent_class;
 };
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeocodeLocation, g_object_unref)
+
 /**
  * GeocodeLocationURIScheme:
  * @GEOCODE_LOCATION_URI_SCHEME_GEO: The 'geo' URI scheme, RFC 5870
diff --git a/geocode-glib/geocode-place.h b/geocode-glib/geocode-place.h
index b71a82c..8f3f5b4 100644
--- a/geocode-glib/geocode-place.h
+++ b/geocode-glib/geocode-place.h
@@ -65,6 +65,8 @@ struct _GeocodePlaceClass {
         GObjectClass parent_class;
 };
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeocodePlace, g_object_unref)
+
 /**
  * GeocodePlaceType:
  * @GEOCODE_PLACE_TYPE_UNKNOWN: Type is unknown for this place.
diff --git a/geocode-glib/geocode-reverse.h b/geocode-glib/geocode-reverse.h
index a64d535..9aa9244 100644
--- a/geocode-glib/geocode-reverse.h
+++ b/geocode-glib/geocode-reverse.h
@@ -63,6 +63,8 @@ struct _GeocodeReverseClass {
        GObjectClass parent_class;
 };
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeocodeReverse, g_object_unref)
+
 GeocodeReverse *geocode_reverse_new_for_location (GeocodeLocation *location);
 
 void geocode_reverse_resolve_async (GeocodeReverse      *object,


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