1b5975d6bSopenharmony_ciFrom cabc49407371800733ada202fab721c9091b6fe6 Mon Sep 17 00:00:00 2001 2b5975d6bSopenharmony_ciFrom: Pavel Sobolev <paveloom@riseup.net> 3b5975d6bSopenharmony_ciDate: Thu, 14 Sep 2023 15:42:24 +0300 4b5975d6bSopenharmony_ciSubject: [PATCH] Make sure the `GTask` is freed on a graceful disconnect 5b5975d6bSopenharmony_ci 6b5975d6bSopenharmony_ciThis fixes the memory leak in the case the connection has been 7b5975d6bSopenharmony_cisuccessfully closed by the peer. 8b5975d6bSopenharmony_ci 9b5975d6bSopenharmony_ci 10b5975d6bSopenharmony_ciConflict:NA 11b5975d6bSopenharmony_ciReference:https://gitlab.gnome.org/GNOME/glib/-/commit/cabc49407371800733ada202fab721c9091b6fe6 12b5975d6bSopenharmony_ci 13b5975d6bSopenharmony_ci--- 14b5975d6bSopenharmony_ci gio/gtcpconnection.c | 3 ++- 15b5975d6bSopenharmony_ci 1 file changed, 2 insertions(+), 1 deletion(-) 16b5975d6bSopenharmony_ci 17b5975d6bSopenharmony_cidiff --git a/gio/gtcpconnection.c b/gio/gtcpconnection.c 18b5975d6bSopenharmony_ciindex 422b3dea52..e0865d859b 100644 19b5975d6bSopenharmony_ci--- a/gio/gtcpconnection.c 20b5975d6bSopenharmony_ci+++ b/gio/gtcpconnection.c 21b5975d6bSopenharmony_ci@@ -206,6 +206,8 @@ async_close_finish (GTask *task, 22b5975d6bSopenharmony_ci g_task_return_error (task, error); 23b5975d6bSopenharmony_ci else 24b5975d6bSopenharmony_ci g_task_return_boolean (task, TRUE); 25b5975d6bSopenharmony_ci+ 26b5975d6bSopenharmony_ci+ g_object_unref (task); 27b5975d6bSopenharmony_ci } 28b5975d6bSopenharmony_ci 29b5975d6bSopenharmony_ci 30b5975d6bSopenharmony_ci@@ -231,7 +233,6 @@ close_read_ready (GSocket *socket, 31b5975d6bSopenharmony_ci else 32b5975d6bSopenharmony_ci { 33b5975d6bSopenharmony_ci async_close_finish (task, error); 34b5975d6bSopenharmony_ci- g_object_unref (task); 35b5975d6bSopenharmony_ci return FALSE; 36b5975d6bSopenharmony_ci } 37b5975d6bSopenharmony_ci } 38b5975d6bSopenharmony_ci-- 39b5975d6bSopenharmony_ciGitLab