summaryrefslogtreecommitdiff
path: root/libnautilus-private/nautilus-mime-actions.c
diff options
context:
space:
mode:
authorDarin Adler <darin@src.gnome.org>2002-03-06 19:24:43 +0000
committerDarin Adler <darin@src.gnome.org>2002-03-06 19:24:43 +0000
commitdc7b7ec4cf3d8dcaa0366138b2d493279f80e8a0 (patch)
tree1091363b3378db6eb69d872cc87aa561849490fa /libnautilus-private/nautilus-mime-actions.c
parent7f7c846b5d97f9fe176f80fb12eb9d8d4f25d0f6 (diff)
downloadnautilus-dc7b7ec4cf3d8dcaa0366138b2d493279f80e8a0.tar.gz
Fix storage leaks.
* libnautilus-private/nautilus-mime-actions.c: (nautilus_mime_set_short_list_applications_for_file), (nautilus_mime_set_short_list_components_for_file): Fix storage leaks.
Diffstat (limited to 'libnautilus-private/nautilus-mime-actions.c')
-rw-r--r--libnautilus-private/nautilus-mime-actions.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/libnautilus-private/nautilus-mime-actions.c b/libnautilus-private/nautilus-mime-actions.c
index 2fdad616b..33f1d6873 100644
--- a/libnautilus-private/nautilus-mime-actions.c
+++ b/libnautilus-private/nautilus-mime-actions.c
@@ -915,11 +915,15 @@ nautilus_mime_set_short_list_applications_for_file (NautilusFile *file,
normal_short_list_ids = g_list_prepend (normal_short_list_ids, ((GnomeVFSMimeApplication *) p->data)->id);
}
+ gnome_vfs_mime_application_list_free (normal_short_list);
+
/* compute delta */
add_list = str_list_difference (applications, normal_short_list_ids);
remove_list = str_list_difference (normal_short_list_ids, applications);
+ eel_g_list_free_deep (normal_short_list_ids);
+
nautilus_file_set_metadata_list
(file,
NAUTILUS_METADATA_KEY_SHORT_LIST_APPLICATION_ADD,
@@ -931,9 +935,8 @@ nautilus_mime_set_short_list_applications_for_file (NautilusFile *file,
NAUTILUS_METADATA_SUBKEY_APPLICATION_ID,
remove_list);
- /* FIXME bugzilla.gnome.org 41269:
- * need to free normal_short_list, normal_short_list_ids, add_list, remove_list
- */
+ eel_g_list_free_deep (add_list);
+ eel_g_list_free_deep (remove_list);
return GNOME_VFS_OK;
}
@@ -953,6 +956,7 @@ nautilus_mime_set_short_list_components_for_file (NautilusFile *file,
GNOME_VFS_ERROR_GENERIC);
/* get per-mime short list */
+
mime_type = nautilus_file_get_mime_type (file);
normal_short_list = gnome_vfs_mime_get_short_list_components (mime_type);
g_free (mime_type);
@@ -962,11 +966,15 @@ nautilus_mime_set_short_list_components_for_file (NautilusFile *file,
normal_short_list_ids = g_list_prepend (normal_short_list_ids, ((Bonobo_ServerInfo *) p->data)->iid);
}
+ gnome_vfs_mime_component_list_free (normal_short_list);
+
/* compute delta */
add_list = str_list_difference (components, normal_short_list_ids);
remove_list = str_list_difference (normal_short_list_ids, components);
+ eel_g_list_free_deep (normal_short_list_ids);
+
nautilus_file_set_metadata_list
(file,
NAUTILUS_METADATA_KEY_SHORT_LIST_COMPONENT_ADD,
@@ -978,9 +986,8 @@ nautilus_mime_set_short_list_components_for_file (NautilusFile *file,
NAUTILUS_METADATA_SUBKEY_COMPONENT_IID,
remove_list);
- /* FIXME bugzilla.gnome.org 41269:
- * need to free normal_short_list, normal_short_list_ids, add_list, remove_list
- */
+ eel_g_list_free_deep (add_list);
+ eel_g_list_free_deep (remove_list);
return GNOME_VFS_OK;
}