diff options
author | Robert Mader <robert.mader@posteo.de> | 2019-11-16 01:25:52 +0100 |
---|---|---|
committer | Florian Müllner <florian.muellner@gmail.com> | 2019-11-21 15:02:27 +0000 |
commit | 92375c75f8d55f545b6c10c359bc9fcbfc596661 (patch) | |
tree | 193cf784732aacfdba9994898a921b4e01665524 /src/backends/meta-monitor-manager.c | |
parent | 22d1febf3c40510ddb6ed2fd5e70b96c3382cb7a (diff) | |
download | mutter-92375c75f8d55f545b6c10c359bc9fcbfc596661.tar.gz |
cleanup: Use g_clear_signal_handler() where possible
This is inspired by 98892391d764d1cf where the usage of
`g_signal_handler_disconnect()` without resetting the corresponding
handler id later resulted in a bug. Using `g_clear_signal_handler()`
makes sure we avoid similar bugs and is almost always the better
alternative. We use it for new code, let's clean up the old code to
also use it.
A further benefit is that it can get called even if the passed id is
0, allowing us to remove a lot of now unnessecary checks, and the fact
that `g_clear_signal_handler()` checks for the right type size, forcing us
to clean up all places where we used `guint` instead of `gulong`.
No functional changes intended here and all changes should be trivial,
thus bundled in one big commit.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/940
Diffstat (limited to 'src/backends/meta-monitor-manager.c')
-rw-r--r-- | src/backends/meta-monitor-manager.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c index a64af1a46..b6368e83a 100644 --- a/src/backends/meta-monitor-manager.c +++ b/src/backends/meta-monitor-manager.c @@ -802,8 +802,8 @@ meta_monitor_manager_finalize (GObject *object) g_list_free_full (manager->logical_monitors, g_object_unref); - g_signal_handler_disconnect (manager->backend, - manager->experimental_features_changed_handler_id); + g_clear_signal_handler (&manager->experimental_features_changed_handler_id, + manager->backend); G_OBJECT_CLASS (meta_monitor_manager_parent_class)->finalize (object); } |