summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2009-05-12 14:21:45 +0200
committerAlexander Larsson <alexl@redhat.com>2009-05-12 14:25:06 +0200
commit28e55c86b931d696b182d0770d583905a9c0ce7f (patch)
treec6b16c942bbafdc8ec4be981af90c42bdd5280f6
parentfe45df2ccfe43077d15c31e21f00f4fb98eea85c (diff)
downloadgvfs-28e55c86b931d696b182d0770d583905a9c0ce7f.tar.gz
Ref the infos in next_files_finish (#582195)
In later glib versions setting the GSimpleAsyncResult gpointer data frees the old data using the destroy notify, which can cause crashes since we return it. So, just copy+ref the list instead of trying to steal the asyncresult one.
-rw-r--r--client/gdaemonfileenumerator.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/client/gdaemonfileenumerator.c b/client/gdaemonfileenumerator.c
index 56b1488d..1aec092e 100644
--- a/client/gdaemonfileenumerator.c
+++ b/client/gdaemonfileenumerator.c
@@ -417,11 +417,8 @@ g_daemon_file_enumerator_next_files_finish (GFileEnumerator *enumerator,
GList *l;
l = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (result));
- /* We want the caller to own this, and not the result, so clear the result data */
- g_simple_async_result_set_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (result),
- NULL, NULL);
-
- return l;
+ g_list_foreach (l, (GFunc)g_object_ref, NULL);
+ return g_list_copy (l);
}
static gboolean