cleanup: Use g_clear_signal_handler() where possible

`g_clear_signal_handler()` is usually cleaner and saver than
`g_signal_handler_disconnect()`. We use it new code, lets also
adopt the existing one.

See also https://gitlab.gnome.org/GNOME/mutter/merge_requests/868
and https://gitlab.gnome.org/GNOME/mutter/merge_requests/940

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/842
This commit is contained in:
Robert Mader
2019-11-21 23:00:53 +01:00
committed by Florian Müllner
parent e7b9bd75d8
commit 135d178d08
10 changed files with 29 additions and 45 deletions

View File

@@ -707,7 +707,7 @@ typedef struct {
ClutterActor *actor;
gint size;
GObject *source;
guint notify_signal_id;
gulong notify_signal_id;
gboolean weakref_active;
} StTextureCachePropertyBind;
@@ -772,7 +772,7 @@ st_texture_cache_bind_weak_notify (gpointer data,
{
StTextureCachePropertyBind *bind = data;
bind->weakref_active = FALSE;
g_signal_handler_disconnect (bind->source, bind->notify_signal_id);
g_clear_signal_handler (&bind->notify_signal_id, bind->source);
}
static void