background: fix various leaks
Fix various leaks found by valgrind.
This commit is contained in:
parent
1418445e13
commit
2b56a5ea0f
7 changed files with 14 additions and 4 deletions
|
@ -105,6 +105,8 @@ bg_colors_source_init (BgColorsSource *self)
|
|||
0, pixbuf,
|
||||
1, item,
|
||||
-1);
|
||||
|
||||
g_object_unref (pixbuf);
|
||||
}
|
||||
|
||||
g_object_unref (thumb_factory);
|
||||
|
|
|
@ -116,6 +116,7 @@ _view_items_added_cb (SwClientItemView *item_view,
|
|||
0, pixbuf,
|
||||
1, item,
|
||||
-1);
|
||||
g_object_unref (pixbuf);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -198,6 +198,7 @@ file_info_async_ready (GObject *source,
|
|||
gtk_tree_path_free (tree_path);
|
||||
|
||||
g_free (filename);
|
||||
g_object_unref (pixbuf);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -326,6 +326,7 @@ backgrounds_changed_cb (GtkIconView *icon_view,
|
|||
|
||||
gtk_tree_model_get_iter (model, &iter, (GtkTreePath*) list->data);
|
||||
|
||||
g_list_foreach (list, (GFunc)gtk_tree_path_free, NULL);
|
||||
g_list_free (list);
|
||||
|
||||
gtk_tree_model_get (model, &iter, 1, &item, -1);
|
||||
|
@ -457,7 +458,6 @@ preview_expose_cb (GtkWidget *widget,
|
|||
priv->thumb_factory,
|
||||
allocation.width,
|
||||
allocation.height);
|
||||
g_object_ref (pixbuf);
|
||||
}
|
||||
|
||||
if (pixbuf)
|
||||
|
|
|
@ -84,4 +84,6 @@ void gnome_wp_info_free (GnomeWPInfo * info) {
|
|||
g_free (info->thumburi);
|
||||
g_free (info->name);
|
||||
g_free (info->mime_type);
|
||||
|
||||
g_free (info);
|
||||
}
|
||||
|
|
|
@ -183,6 +183,8 @@ void gnome_wp_item_free (GnomeWPItem * item) {
|
|||
|
||||
gtk_tree_row_reference_free (item->rowref);
|
||||
|
||||
g_free (item->source_url);
|
||||
|
||||
g_free (item);
|
||||
}
|
||||
|
||||
|
@ -256,7 +258,7 @@ void gnome_wp_item_update_description (GnomeWPItem * item) {
|
|||
if (!strcmp (item->filename, "(none)")) {
|
||||
item->description = g_strdup (item->name);
|
||||
} else {
|
||||
const gchar *description;
|
||||
gchar *description;
|
||||
gchar *size;
|
||||
gchar *dirname = g_path_get_dirname (item->filename);
|
||||
|
||||
|
@ -266,9 +268,9 @@ void gnome_wp_item_update_description (GnomeWPItem * item) {
|
|||
if (strcmp (item->fileinfo->mime_type, "application/xml") == 0)
|
||||
{
|
||||
if (gnome_bg_changes_with_time (item->bg))
|
||||
description = _("Slide Show");
|
||||
description = g_strdup (_("Slide Show"));
|
||||
else if (item->width > 0 && item->height > 0)
|
||||
description = _("Image");
|
||||
description = g_strdup (_("Image"));
|
||||
}
|
||||
else
|
||||
description = g_content_type_get_description (item->fileinfo->mime_type);
|
||||
|
@ -311,5 +313,6 @@ void gnome_wp_item_update_description (GnomeWPItem * item) {
|
|||
|
||||
g_free (size);
|
||||
g_free (dirname);
|
||||
g_free (description);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -333,6 +333,7 @@ static void gnome_wp_xml_load_from_dir (const gchar *path,
|
|||
gnome_wp_xml_add_monitor (directory, data);
|
||||
|
||||
g_object_unref (directory);
|
||||
g_object_unref (enumerator);
|
||||
}
|
||||
|
||||
void gnome_wp_xml_load_list (GnomeWpXml *data) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue