[gnome-builder] unsaved-files: do not autofree the content
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] unsaved-files: do not autofree the content
- Date: Sat, 11 Apr 2015 10:30:33 +0000 (UTC)
commit e0fb706d4e700e1be4ac9092b605baedd915a951
Author: Paolo Borelli <pborelli gnome org>
Date: Sat Apr 11 12:26:33 2015 +0200
unsaved-files: do not autofree the content
g_bytes_new_take takes ownership of this data, so we should not free it.
Also rename a var to avoid shadowing.
libide/ide-unsaved-files.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/libide/ide-unsaved-files.c b/libide/ide-unsaved-files.c
index d5056b5..27d172f 100644
--- a/libide/ide-unsaved-files.c
+++ b/libide/ide-unsaved-files.c
@@ -274,7 +274,7 @@ ide_unsaved_files_restore_worker (GTask *task,
GCancellable *cancellable)
{
AsyncState *state = task_data;
- g_autofree gchar *contents = NULL;
+ g_autofree gchar *manifest_contents = NULL;
g_autofree gchar *manifest_path = NULL;
gchar **lines;
GError *error = NULL;
@@ -295,18 +295,18 @@ ide_unsaved_files_restore_worker (GTask *task,
return;
}
- if (!g_file_get_contents (manifest_path, &contents, &len, &error))
+ if (!g_file_get_contents (manifest_path, &manifest_contents, &len, &error))
{
g_task_return_error (task, error);
return;
}
- lines = g_strsplit (contents, "\n", 0);
+ lines = g_strsplit (manifest_contents, "\n", 0);
for (i = 0; lines [i]; i++)
{
g_autoptr(GFile) file = NULL;
- g_autofree gchar *contents = NULL;
+ gchar *contents = NULL;
g_autofree gchar *hash = NULL;
g_autofree gchar *path = NULL;
UnsavedFile *unsaved;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]