From 08456c8043e33ed8306380d14cca1db8cc346b7f Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Wed, 15 Dec 2021 13:37:34 +0100 Subject: [PATCH] in-app-notification: Use g_clear_* instead of emulating it --- src/calls-in-app-notification.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/calls-in-app-notification.c b/src/calls-in-app-notification.c index 0b56472..b0ef204 100644 --- a/src/calls-in-app-notification.c +++ b/src/calls-in-app-notification.c @@ -100,8 +100,7 @@ calls_in_app_notification_finalize (GObject *object) { CallsInAppNotification *self = CALLS_IN_APP_NOTIFICATION (object); - if (self->timeout_id) - g_source_remove (self->timeout_id); + g_clear_handle_id (&self->timeout_id, g_source_remove); G_OBJECT_CLASS (calls_in_app_notification_parent_class)->finalize (object); } @@ -169,11 +168,7 @@ calls_in_app_notification_hide (CallsInAppNotification *self) { g_return_if_fail (CALLS_IS_IN_APP_NOTIFICATION (self)); - if (self->timeout_id) - { - g_source_remove (self->timeout_id); - self->timeout_id = 0; - } + g_clear_handle_id (&self->timeout_id, g_source_remove); gtk_revealer_set_reveal_child (GTK_REVEALER(self), FALSE); }