[gnome-photos] pipeline: Don't save garbage
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] pipeline: Don't save garbage
- Date: Mon, 28 Dec 2015 16:43:09 +0000 (UTC)
commit 49d1e27724015cecf51d0d57cb7db65f26d0d42e
Author: Debarshi Ray <debarshir gnome org>
Date: Mon Dec 28 17:34:32 2015 +0100
pipeline: Don't save garbage
This bug was introduced by a careless round of style 'fixes' before
merging the code.
src/photos-pipeline.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/photos-pipeline.c b/src/photos-pipeline.c
index f8f8e36..087b126 100644
--- a/src/photos-pipeline.c
+++ b/src/photos-pipeline.c
@@ -522,7 +522,11 @@ photos_pipeline_save_async (PhotosPipeline *self,
task = g_task_new (self, cancellable, callback, user_data);
g_task_set_source_tag (task, photos_pipeline_save_async);
- g_task_set_task_data (task, g_strdup (xml), g_free);
+
+ /* We need to keep 'xml' alive until g_file_replace_contents_async
+ * returns.
+ */
+ g_task_set_task_data (task, xml, g_free);
file = g_file_new_for_uri (self->uri);
len = strlen (xml);
@@ -536,7 +540,6 @@ photos_pipeline_save_async (PhotosPipeline *self,
photos_pipeline_save_replace_contents,
g_object_ref (task));
- g_free (xml);
g_object_unref (file);
g_object_unref (task);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]