gsignal: Plug g_signal_connect_object leak

commit 916297be79 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.
This commit is contained in:
Ray Strode 2020-10-13 09:24:02 -04:00 committed by Philip Withnall
parent 0e8066e350
commit 152a9b6abb

View File

@ -3916,6 +3916,7 @@ invalid_closure_notify (gpointer instance,
g_assert (handler != NULL); g_assert (handler != NULL);
g_assert (handler->closure == closure); g_assert (handler->closure == closure);
g_hash_table_remove (g_handlers, handler);
handler->sequential_number = 0; handler->sequential_number = 0;
handler->block_count = 1; handler->block_count = 1;
handler_unref_R (signal_id, instance, handler); handler_unref_R (signal_id, instance, handler);