glib2/backport-gsignal-Plug-g-signal-connect-object-leak.patch
shirely16 a3d31ddf3c synchronous community patch
(cherry picked from commit 5fb95aa15490a21b390e53a88c1b8b052971e504)
2021-05-21 15:56:45 +08:00

40 lines
1.3 KiB
Diff

From d691c2ebd269e394457d6367db14cf2cc22bc281 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Tue, 13 Oct 2020 09:24:02 -0400
Subject: [PATCH 0999/1095] gsignal: Plug g_signal_connect_object leak
commit 916297be799ee001b4a214cc52c3b960bb0b5deb added a hash table
to provide constant time lookups of signal handlers.
Unfortunately, that commit neglected to remove handlers from
g_signal_connect_object calls from the hash table that are
disconnected implicitly when the associated object goes away.
This commit addresses that bug by changing the closure invalidate
handler associated with the signal connection to properly remove the
handler from the hash table.
reason:Plug g_signal_connect_object leak
Conflict:NA
Reference:https://github.com/GNOME/glib/commit/d691c2ebd269e394457d6367db14cf2cc22bc281
---
gobject/gsignal.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/gobject/gsignal.c b/gobject/gsignal.c
index ebf5b3c..41599eb 100644
--- a/gobject/gsignal.c
+++ b/gobject/gsignal.c
@@ -3916,6 +3916,7 @@ invalid_closure_notify (gpointer instance,
g_assert (handler != NULL);
g_assert (handler->closure == closure);
+ g_hash_table_remove (g_handlers, handler);
handler->sequential_number = 0;
handler->block_count = 1;
handler_unref_R (signal_id, instance, handler);
--
1.8.3.1