From edb7ccb661746fd55ed3b935b44a61d011a0807c Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 12 May 2009 14:21:45 +0200 Subject: [PATCH 3/4] 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. --- client/gdaemonfileenumerator.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/client/gdaemonfileenumerator.c b/client/gdaemonfileenumerator.c index 56b1488..1aec092 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 -- 1.6.2.2