Commit 125b37be authored by Igor's avatar Igor

Free lists properly

parent 743c0d68
......@@ -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;
......
......@@ -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;
}
......
......@@ -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);
}
......
......@@ -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;
}
......
......@@ -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;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment