mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-10-31 11:36:18 +01:00
gdump: Fix leaked io streams
This makes Meson unit test fail: https://github.com/mesonbuild/meson/issues/11754
This commit is contained in:
parent
9a910e44aa
commit
a194c42129
10
gdump.c
10
gdump.c
@ -594,6 +594,7 @@ g_irepository_dump (const char *arg, GError **error)
|
||||
if (output == NULL)
|
||||
{
|
||||
g_input_stream_close (G_INPUT_STREAM (input), NULL, NULL);
|
||||
g_object_unref (input);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -674,11 +675,12 @@ g_irepository_dump (const char *arg, GError **error)
|
||||
ioerror = NULL;
|
||||
else
|
||||
ioerror = error;
|
||||
if (!g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror))
|
||||
return FALSE;
|
||||
if (!g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror))
|
||||
return FALSE;
|
||||
caught_error |= !g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror);
|
||||
caught_error |= !g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror);
|
||||
}
|
||||
|
||||
g_object_unref (in);
|
||||
g_object_unref (output);
|
||||
|
||||
return !caught_error;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user