[PATCH 15/15] core: Get a copy of failed keys



When source invokes callback, the list of failed keys must be copied to keep
after returning, as source will free that list.

In order words, that list is constant.
---
 src/grl-metadata-source.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/grl-metadata-source.c b/src/grl-metadata-source.c
index 54b28f5..8afa38b 100644
--- a/src/grl-metadata-source.c
+++ b/src/grl-metadata-source.c
@@ -313,7 +313,8 @@ set_metadata_ctl_cb (GrlMetadataSource *source,
   smctlcb = (struct SetMetadataCtlCb *) user_data;
 
   if (failed_keys) {
-    smctlcb->failed_keys = g_list_concat (smctlcb->failed_keys, failed_keys);
+    smctlcb->failed_keys = g_list_concat (smctlcb->failed_keys,
+                                          g_list_copy (failed_keys));
   }
 
   smctlcb->pending--;
-- 
1.7.0.4



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]