From 72c77c6f4a9e67fa9b74265b4b5f444c744b2bc6 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Wed, 3 May 2000 04:06:19 +0000 Subject: New function to free a list of referenced objects. svn path=/trunk/; revision=2772 --- e-util/ChangeLog | 6 ++++++ e-util/e-util.c | 15 ++++++++++++++- e-util/e-util.c-8611 | 15 ++++++++++++++- e-util/e-util.h | 8 ++++++-- e-util/e-util.h-29002 | 8 ++++++-- 5 files changed, 46 insertions(+), 6 deletions(-) (limited to 'e-util') diff --git a/e-util/ChangeLog b/e-util/ChangeLog index e01604b3b7..5a65629ce1 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,9 @@ +2000-05-03 Ettore Perazzoli + + * e-util.h: #include and . + + * e-util.c (e_free_object_list): New utility function. + 2000-05-02 Damon Chaplin * e-canvas.c (e_canvas_focus_in): diff --git a/e-util/e-util.c b/e-util/e-util.c index d637b33729..f2d787f37e 100644 --- a/e-util/e-util.c +++ b/e-util/e-util.c @@ -20,8 +20,10 @@ * Boston, MA 02111-1307, USA. */ -#include "e-util.h" #include +#include + +#include "e-util.h" int g_str_compare(const void *x, const void *y) @@ -39,3 +41,14 @@ g_int_compare(const void *x, const void *y) else return -1; } + +void +e_free_object_list (GList *list) +{ + GList *p; + + for (p = list; p != NULL; p = p->next) + gtk_object_unref (GTK_OBJECT (p->data)); + + g_list_free (list); +} diff --git a/e-util/e-util.c-8611 b/e-util/e-util.c-8611 index d637b33729..f2d787f37e 100644 --- a/e-util/e-util.c-8611 +++ b/e-util/e-util.c-8611 @@ -20,8 +20,10 @@ * Boston, MA 02111-1307, USA. */ -#include "e-util.h" #include +#include + +#include "e-util.h" int g_str_compare(const void *x, const void *y) @@ -39,3 +41,14 @@ g_int_compare(const void *x, const void *y) else return -1; } + +void +e_free_object_list (GList *list) +{ + GList *p; + + for (p = list; p != NULL; p = p->next) + gtk_object_unref (GTK_OBJECT (p->data)); + + g_list_free (list); +} diff --git a/e-util/e-util.h b/e-util/e-util.h index e5635cdf16..a3380b9ea4 100644 --- a/e-util/e-util.h +++ b/e-util/e-util.h @@ -1,6 +1,9 @@ #ifndef _E_UTIL_H_ #define _E_UTIL_H_ +#include +#include + #define E_MAKE_TYPE(l,str,t,ci,i,parent) \ GtkType l##_get_type(void)\ {\ @@ -19,8 +22,7 @@ GtkType l##_get_type(void)\ type = gtk_type_unique (parent, &info);\ }\ return type;\ -}\ - +} typedef enum { E_FOCUS_NONE, @@ -32,4 +34,6 @@ typedef enum { int g_str_compare(const void *x, const void *y); int g_int_compare(const void *x, const void *y); +void e_free_object_list (GList *list); + #endif /* _E_UTIL_H_ */ diff --git a/e-util/e-util.h-29002 b/e-util/e-util.h-29002 index e5635cdf16..a3380b9ea4 100644 --- a/e-util/e-util.h-29002 +++ b/e-util/e-util.h-29002 @@ -1,6 +1,9 @@ #ifndef _E_UTIL_H_ #define _E_UTIL_H_ +#include +#include + #define E_MAKE_TYPE(l,str,t,ci,i,parent) \ GtkType l##_get_type(void)\ {\ @@ -19,8 +22,7 @@ GtkType l##_get_type(void)\ type = gtk_type_unique (parent, &info);\ }\ return type;\ -}\ - +} typedef enum { E_FOCUS_NONE, @@ -32,4 +34,6 @@ typedef enum { int g_str_compare(const void *x, const void *y); int g_int_compare(const void *x, const void *y); +void e_free_object_list (GList *list); + #endif /* _E_UTIL_H_ */ -- cgit v1.2.3