summaryrefslogtreecommitdiff
path: root/client/gdaemonfileenumerator.c
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:21:45 +0200
commitedb7ccb661746fd55ed3b935b44a61d011a0807c (patch)
tree126b75cb573c0a73731670cfc3389b9806973ebd /client/gdaemonfileenumerator.c
parentd0a339d10b789c53352b61b291eb55d67f770254 (diff)
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.
Diffstat (limited to 'client/gdaemonfileenumerator.c')
-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