[gnome-photos/wip/rishi/handle-urn-changes: 2/4] utils: Add photos_utils_object_list_free_full



commit 4b262b27a2b536517e865208edbb16bad75e6580
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Sep 8 14:16:37 2016 +0200

    utils: Add photos_utils_object_list_free_full
    
    It is a convenience function for freeing a list of GObjects meant to be
    used as a GDestroyNotify. It will be useful in the subsequent commit.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=770267

 src/photos-utils.c |    7 +++++++
 src/photos-utils.h |    2 ++
 2 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/photos-utils.c b/src/photos-utils.c
index 45b0baa..e5d554e 100644
--- a/src/photos-utils.c
+++ b/src/photos-utils.c
@@ -1356,6 +1356,13 @@ photos_utils_make_directory_with_parents (GFile *file, GCancellable *cancellable
 }
 
 
+void
+photos_utils_object_list_free_full (GList *objects)
+{
+  g_list_free_full (objects, (GDestroyNotify) g_object_unref);
+}
+
+
 GQuark
 photos_utils_orientation_bottom_quark (void)
 {
diff --git a/src/photos-utils.h b/src/photos-utils.h
index 8f9cf0f..f161e17 100644
--- a/src/photos-utils.h
+++ b/src/photos-utils.h
@@ -169,6 +169,8 @@ void             photos_utils_list_box_header_func        (GtkListBoxRow *row,
 
 gboolean         photos_utils_make_directory_with_parents (GFile *file, GCancellable *cancellable, GError 
**error);
 
+void             photos_utils_object_list_free_full       (GList *objects);
+
 GQuark           photos_utils_orientation_bottom_quark    (void);
 
 GQuark           photos_utils_orientation_left_quark      (void);


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