Make sure the GTask is freed on a graceful disconnect

This fixes the memory leak in the case the connection has been
successfully closed by the peer.

Part-of: <https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3609>
This commit is contained in:
Pavel Sobolev 2023-09-14 15:42:24 +03:00 committed by Philip Withnall
parent ca1949a45a
commit 1470bf1c1a

View File

@ -206,6 +206,8 @@ async_close_finish (GTask *task,
g_task_return_error (task, error);
else
g_task_return_boolean (task, TRUE);
g_object_unref (task);
}
@ -231,7 +233,6 @@ close_read_ready (GSocket *socket,
else
{
async_close_finish (task, error);
g_object_unref (task);
return FALSE;
}
}