[Xfce4-commits] [apps/ristretto] 01/01: Free lists properly

noreply at xfce.org noreply at xfce.org
Sat Jun 30 18:42:07 CEST 2018


This is an automated email from the git hooks/post-receive script.

f   2   4   0   4       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/ristretto.

commit 125b37bea9c0620c1f1ea72da09fbd1f051e54e1
Author: Igor <f2404 at yandex.ru>
Date:   Sat Jun 30 12:42:00 2018 -0400

    Free lists properly
---
 src/icon_bar.c       |  3 +--
 src/image_list.c     | 12 ++++--------
 src/main_window.c    | 13 ++++---------
 src/privacy_dialog.c |  3 +--
 src/thumbnailer.c    |  6 ++----
 5 files changed, 12 insertions(+), 25 deletions(-)

diff --git a/src/icon_bar.c b/src/icon_bar.c
index 189a01e..1bcb691 100644
--- a/src/icon_bar.c
+++ b/src/icon_bar.c
@@ -1725,8 +1725,7 @@ rstto_icon_bar_set_model (
 
         g_object_unref (G_OBJECT (icon_bar->priv->model));
 
-        g_list_foreach (icon_bar->priv->items, (GFunc) rstto_icon_bar_item_free, NULL);
-        g_list_free (icon_bar->priv->items);
+        g_list_free_full (icon_bar->priv->items, (GDestroyNotify) rstto_icon_bar_item_free);
         icon_bar->priv->active_item = NULL;
         icon_bar->priv->cursor_item = NULL;
         icon_bar->priv->items = NULL;
diff --git a/src/image_list.c b/src/image_list.c
index f37dd8c..012a26f 100644
--- a/src/image_list.c
+++ b/src/image_list.c
@@ -638,16 +638,13 @@ rstto_image_list_remove_all (RsttoImageList *image_list)
 
         gtk_tree_model_row_deleted(GTK_TREE_MODEL(image_list), path_);
 
-        
-        image_iter = g_list_next (image_iter);     
+        image_iter = g_list_next (image_iter);
     }
 
-    g_list_foreach (image_list->priv->image_monitors, (GFunc)g_object_unref, NULL);
-    g_list_free (image_list->priv->image_monitors);
+    g_list_free_full (image_list->priv->image_monitors, (GDestroyNotify) g_object_unref);
     image_list->priv->image_monitors = NULL;
 
-    g_list_foreach (image_list->priv->images, (GFunc)g_object_unref, NULL);
-    g_list_free (image_list->priv->images);
+    g_list_free_full (image_list->priv->images, (GDestroyNotify) g_object_unref);
     image_list->priv->images = NULL;
 
     iter = image_list->priv->iterators;
@@ -848,8 +845,7 @@ rstto_image_list_monitor_dir (
 
     if (image_list->priv->image_monitors)
     {
-        g_list_foreach (image_list->priv->image_monitors, (GFunc)g_object_unref, NULL);
-        g_list_free (image_list->priv->image_monitors);
+        g_list_free_full (image_list->priv->image_monitors, (GDestroyNotify) g_object_unref);
         image_list->priv->image_monitors = NULL;
     }
 
diff --git a/src/main_window.c b/src/main_window.c
index 78c0be2..9387689 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -1406,8 +1406,7 @@ rstto_main_window_image_list_iter_changed (RsttoMainWindow *window)
                 menu_item = gtk_separator_menu_item_new ();
                 gtk_menu_shell_append (GTK_MENU_SHELL (open_with_menu), menu_item);
 
-                g_list_foreach (app_list, (GFunc)g_object_unref, NULL);
-                g_list_free (app_list);
+                g_list_free_full (app_list, (GDestroyNotify) g_object_unref);
             }
             else
             {
@@ -3219,8 +3218,7 @@ cb_rstto_main_window_open_image (GtkWidget *widget, RsttoMainWindow *window)
 
     if (files)
     {
-        g_slist_foreach (files, (GFunc)g_object_unref, NULL);
-        g_slist_free (files);
+        g_slist_free_full (files, (GDestroyNotify) g_object_unref);
     }
 }
 
@@ -4258,11 +4256,8 @@ rstto_main_window_launch_editor_chooser (
 
     gtk_widget_destroy (dialog);
 
-    g_list_foreach (app_infos_recommended, (GFunc)g_object_unref, NULL);
-    g_list_foreach (app_infos_all, (GFunc)g_object_unref, NULL);
-    
-    g_list_free (app_infos_recommended);
-    g_list_free (app_infos_all);
+    g_list_free_full (app_infos_recommended, (GDestroyNotify) g_object_unref);
+    g_list_free_full (app_infos_all, (GDestroyNotify) g_object_unref);
     g_list_free (files);
 }
 
diff --git a/src/privacy_dialog.c b/src/privacy_dialog.c
index 40cc57a..7b1fec6 100644
--- a/src/privacy_dialog.c
+++ b/src/privacy_dialog.c
@@ -395,8 +395,7 @@ rstto_recent_chooser_get_items (
         all_items_iter = g_list_next (all_items_iter);
     }
 
-    g_list_foreach (all_items, (GFunc)gtk_recent_info_unref, NULL);
-    g_list_free (all_items);
+    g_list_free_full (all_items, (GDestroyNotify) gtk_recent_info_unref);
 
     return items;
 }
diff --git a/src/thumbnailer.c b/src/thumbnailer.c
index ba7be67..ab7913e 100644
--- a/src/thumbnailer.c
+++ b/src/thumbnailer.c
@@ -352,8 +352,7 @@ rstto_thumbnailer_dequeue_file (
              * being processed, no big deal */
         }
         thumbnailer->priv->handle = 0;
-        g_slist_foreach (thumbnailer->priv->in_process_queue, (GFunc)g_object_unref, NULL);
-        g_slist_free (thumbnailer->priv->in_process_queue);
+        g_slist_free_full (thumbnailer->priv->in_process_queue, (GDestroyNotify) g_object_unref);
         thumbnailer->priv->in_process_queue = NULL;
     }
 
@@ -491,8 +490,7 @@ cb_rstto_thumbnailer_request_finished (
 
     if (thumbnailer->priv->in_process_queue)
     {
-        g_slist_foreach (thumbnailer->priv->in_process_queue, (GFunc)g_object_unref, NULL);
-        g_slist_free (thumbnailer->priv->in_process_queue);
+        g_slist_free_full (thumbnailer->priv->in_process_queue, (GDestroyNotify) g_object_unref);
         thumbnailer->priv->in_process_queue = NULL;
     }
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list