mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-03 17:56:17 +01:00
glib-compile-resources: Fix size allocation for compressed streams
The length of the stolen data from a memory output stream is given by get_data_size() — get_size() can be larger, and hence cause unnecessary overallocation.
This commit is contained in:
parent
a3ad5a2ce0
commit
0985e70488
@ -483,7 +483,7 @@ end_element (GMarkupParseContext *context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
g_free (data->content);
|
g_free (data->content);
|
||||||
data->content_size = g_memory_output_stream_get_size (G_MEMORY_OUTPUT_STREAM (out));
|
data->content_size = g_memory_output_stream_get_data_size (G_MEMORY_OUTPUT_STREAM (out));
|
||||||
data->content = g_memory_output_stream_steal_data (G_MEMORY_OUTPUT_STREAM (out));
|
data->content = g_memory_output_stream_steal_data (G_MEMORY_OUTPUT_STREAM (out));
|
||||||
|
|
||||||
g_object_unref (compressor);
|
g_object_unref (compressor);
|
||||||
|
Loading…
Reference in New Issue
Block a user