aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2000-05-03 12:06:19 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2000-05-03 12:06:19 +0800
commit72c77c6f4a9e67fa9b74265b4b5f444c744b2bc6 (patch)
tree5eebabe7fcb1c394e21133262747346d152eafe9
parentf27621c3a268ed5ea9ff320d6d049bac76e28a37 (diff)
downloadgsoc2013-evolution-72c77c6f4a9e67fa9b74265b4b5f444c744b2bc6.tar.gz
gsoc2013-evolution-72c77c6f4a9e67fa9b74265b4b5f444c744b2bc6.tar.zst
gsoc2013-evolution-72c77c6f4a9e67fa9b74265b4b5f444c744b2bc6.zip
New function to free a list of referenced objects.
svn path=/trunk/; revision=2772
-rw-r--r--e-util/ChangeLog6
-rw-r--r--e-util/e-util.c15
-rw-r--r--e-util/e-util.c-861115
-rw-r--r--e-util/e-util.h8
-rw-r--r--e-util/e-util.h-290028
5 files changed, 46 insertions, 6 deletions
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 <ettore@helixcode.com>
+
+ * e-util.h: #include <glib.h> and <gtk/gtktypeutils.h>.
+
+ * e-util.c (e_free_object_list): New utility function.
+
2000-05-02 Damon Chaplin <damon@helixcode.com>
* 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 <glib.h>
+#include <gtk/gtkobject.h>
+
+#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 <glib.h>
+#include <gtk/gtkobject.h>
+
+#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 <glib.h>
+#include <gtk/gtktypeutils.h>
+
#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 <glib.h>
+#include <gtk/gtktypeutils.h>
+
#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_ */