[calls] in-app-notification: Use g_clear_* instead of emulating it



commit 08456c8043e33ed8306380d14cca1db8cc346b7f
Author: Evangelos Ribeiro Tzaras <devrtz fortysixandtwo eu>
Date:   Wed Dec 15 13:37:34 2021 +0100

    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 0b56472f..b0ef204b 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);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]