From ecb2a7c820f386e547e8ce2c52fe7001390dc1bd Mon Sep 17 00:00:00 2001 From: Justin Kim Date: Wed, 30 Sep 2015 17:26:31 +0900 Subject: [PATCH] project: don't leak GFileInfo https://bugzilla.gnome.org/show_bug.cgi?id=755862 --- ges/ges-project.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ges/ges-project.c b/ges/ges-project.c index ae5dc15023..3b36fa1e6c 100644 --- a/ges/ges-project.c +++ b/ges/ges-project.c @@ -269,9 +269,8 @@ _add_media_new_paths_recursing (const gchar * value) GST_INFO ("Adding folder: %s", value); g_ptr_array_add (new_paths, g_strdup (value)); - for (info = g_file_enumerator_next_file (fenum, NULL, NULL); - info; info = g_file_enumerator_next_file (fenum, NULL, NULL)) { - + info = g_file_enumerator_next_file (fenum, NULL, NULL); + while (info != NULL) { if (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY) { GFile *f = g_file_enumerator_get_child (fenum, info); gchar *uri = g_file_get_uri (f); @@ -280,6 +279,8 @@ _add_media_new_paths_recursing (const gchar * value) gst_object_unref (f); g_free (uri); } + g_object_unref (info); + info = g_file_enumerator_next_file (fenum, NULL, NULL); } done: