[gnome-maps/gnome-43] file-data-source: Read content bytes into the correct object
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/gnome-43] file-data-source: Read content bytes into the correct object
- Date: Thu, 22 Sep 2022 19:21:53 +0000 (UTC)
commit 3dd850c6b74c918767841af62e687abc590039c4
Author: Marcus Lundblad <ml dfupdate se>
Date: Tue Sep 13 23:08:33 2022 +0200
file-data-source: Read content bytes into the correct object
Store the file byte contents into the task data structure.
The bytes were actually stored in a local bytes object,
resulting in null being passed to the renderer.
lib/maps-file-data-source.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/lib/maps-file-data-source.c b/lib/maps-file-data-source.c
index 2e326f58..40a3f91b 100644
--- a/lib/maps-file-data-source.c
+++ b/lib/maps-file-data-source.c
@@ -470,15 +470,14 @@ on_file_load (GObject *source_object,
FillTileData *data = g_task_get_task_data (task);
char *contents;
gsize length;
- GBytes *bytes;
g_file_load_contents_finish (data->file, res, &contents, &length, NULL, NULL);
if (contents != NULL)
{
- bytes = g_bytes_new_take (contents, length);
+ data->bytes = g_bytes_new_take (contents, length);
g_signal_emit_by_name (data->self, "received-data", data->x, data->y, data->z, data->bytes);
- g_task_return_pointer (task, g_steal_pointer (&bytes), (GDestroyNotify)g_bytes_unref);
+ g_task_return_pointer (task, g_steal_pointer (&data->bytes), (GDestroyNotify)g_bytes_unref);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]