[metacity] util: remove meta_free_gslist_and_elements



commit 42caba8c77b5e316ab166714c35fe180233f1011
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sun Sep 2 13:34:43 2018 +0300

    util: remove meta_free_gslist_and_elements

 src/core/util.c    | 9 ---------
 src/core/window.c  | 4 ++--
 src/include/util.h | 2 --
 3 files changed, 2 insertions(+), 13 deletions(-)
---
diff --git a/src/core/util.c b/src/core/util.c
index b2e4debe..1459160b 100644
--- a/src/core/util.c
+++ b/src/core/util.c
@@ -201,15 +201,6 @@ utf8_fputs (const char *str,
   return retval;
 }
 
-void
-meta_free_gslist_and_elements (GSList *list_to_deep_free)
-{
-  g_slist_foreach (list_to_deep_free,
-                   (void (*)(gpointer,gpointer))&g_free, /* ew, for ugly */
-                   NULL);
-  g_slist_free (list_to_deep_free);
-}
-
 void
 meta_verbose (const char *format, ...)
 {
diff --git a/src/core/window.c b/src/core/window.c
index cc482026..325f9294 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -1114,7 +1114,7 @@ meta_window_unmanage (MetaWindow *window,
 
   if (window->struts)
     {
-      meta_free_gslist_and_elements (window->struts);
+      g_slist_free_full (window->struts, g_free);
       window->struts = NULL;
 
       meta_topic (META_DEBUG_WORKAREA,
@@ -6523,7 +6523,7 @@ meta_window_update_struts (MetaWindow *window)
   changed = (old_iter != NULL || new_iter != NULL);
 
   /* Update appropriately */
-  meta_free_gslist_and_elements (old_struts);
+  g_slist_free_full (old_struts, g_free);
   window->struts = new_struts;
   if (changed)
     {
diff --git a/src/include/util.h b/src/include/util.h
index 2fdd0384..79a8b058 100644
--- a/src/include/util.h
+++ b/src/include/util.h
@@ -86,8 +86,6 @@ const char* meta_gravity_to_string (int gravity);
 
 char* meta_g_utf8_strndup (const gchar *src, gsize n);
 
-void  meta_free_gslist_and_elements (GSList *list_to_deep_free);
-
 GPid meta_show_dialog (const char *type,
                        const char *message,
                        const char *timeout,


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