[gnome-remote-desktop] session-rdp: Use g_clear_handle_id to clear close_session_idle_id



commit e75659e943e08d3054952441a58f7f62373d1926
Author: Pascal Nowack <Pascal Nowack gmx de>
Date:   Fri Jan 1 19:33:39 2021 +0100

    session-rdp: Use g_clear_handle_id to clear close_session_idle_id
    
    It's shorter, more compact and does the same as manually checking the
    id, removing the source if the id is non-zero and setting the id to 0.

 src/grd-session-rdp.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
---
diff --git a/src/grd-session-rdp.c b/src/grd-session-rdp.c
index fc073e3..bb44a0f 100644
--- a/src/grd-session-rdp.c
+++ b/src/grd-session-rdp.c
@@ -1494,11 +1494,7 @@ grd_session_rdp_stop (GrdSession *session)
                                clear_pointer_bitmap,
                                NULL);
 
-  if (session_rdp->close_session_idle_id)
-    {
-      g_source_remove (session_rdp->close_session_idle_id);
-      session_rdp->close_session_idle_id = 0;
-    }
+  g_clear_handle_id (&session_rdp->close_session_idle_id, g_source_remove);
 }
 
 static gboolean


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