Merge branch 'fix-unix-streams-error-leak' into 'main'

tests/unix-streams: Free the cancelled error on cancelled cancellable

See merge request GNOME/glib!2892
This commit is contained in:
Philip Withnall 2022-10-10 12:02:56 +00:00
commit 1d2ea6518c

View File

@ -146,7 +146,9 @@ main_thread_skipped (GObject *source, GAsyncResult *res, gpointer user_data)
if (g_cancellable_is_cancelled (main_cancel))
{
g_assert_error (err, G_IO_ERROR, G_IO_ERROR_CANCELLED);
do_main_cancel (out);
g_clear_error (&err);
return;
}
@ -180,6 +182,7 @@ main_thread_read (GObject *source, GAsyncResult *res, gpointer user_data)
if (g_cancellable_is_cancelled (main_cancel))
{
g_assert_error (err, G_IO_ERROR, G_IO_ERROR_CANCELLED);
do_main_cancel (out);
g_clear_error (&err);
return;
@ -217,6 +220,7 @@ main_thread_wrote (GObject *source, GAsyncResult *res, gpointer user_data)
if (g_cancellable_is_cancelled (main_cancel))
{
g_assert_error (err, G_IO_ERROR, G_IO_ERROR_CANCELLED);
do_main_cancel (out);
g_clear_error (&err);
return;