diff options
author | Alessandro Bono <alessandro.bono369@gmail.com> | 2022-09-28 13:50:12 +0200 |
---|---|---|
committer | Ray Strode <halfline@gmail.com> | 2022-10-27 12:56:03 +0000 |
commit | 79651b8d7ecfe2bbf1b25271500c64b2c5353969 (patch) | |
tree | 2eaef349d2bbec22eb3ef5fc51e9ea003d8ac0d5 /chooser | |
parent | 33bccd1ee5d5a5a5e2f1cf90bf461764e5680597 (diff) | |
download | gdm-79651b8d7ecfe2bbf1b25271500c64b2c5353969.tar.gz |
gdm-host-chooser-widget: Use g_clear_handle_id
Diffstat (limited to 'chooser')
-rw-r--r-- | chooser/gdm-host-chooser-widget.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/chooser/gdm-host-chooser-widget.c b/chooser/gdm-host-chooser-widget.c index 0b67c587..bd2a7f79 100644 --- a/chooser/gdm-host-chooser-widget.c +++ b/chooser/gdm-host-chooser-widget.c @@ -414,9 +414,7 @@ xdmcp_discover (GdmHostChooserWidget *widget) do_ping (widget, TRUE); #if 0 - if (widget->scan_time_id > 0) { - g_source_remove (widget->scan_time_id); - } + g_clear_handle_id (&widget->scan_time_id, g_source_remove); widget->scan_time_id = g_timeout_add_seconds (SCAN_TIMEOUT, chooser_scan_time_update, @@ -424,9 +422,7 @@ xdmcp_discover (GdmHostChooserWidget *widget) #endif /* Note we already used up one try */ widget->ping_tries = PING_TRIES - 1; - if (widget->ping_try_id > 0) { - g_source_remove (widget->ping_try_id); - } + g_clear_handle_id (&widget->ping_try_id, g_source_remove); widget->ping_try_id = g_timeout_add_seconds (PING_TIMEOUT, (GSourceFunc)ping_try, |