[glib: 1/5] gdbusauth: Use g_clear_object() to simplify the code a little




commit 137a9bdcc2ef77580d6ba695d2748496b75e2c27
Author: Philip Withnall <pwithnall endlessos org>
Date:   Tue Dec 15 12:58:21 2020 +0000

    gdbusauth: Use g_clear_object() to simplify the code a little
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>

 gio/gdbusauth.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/gio/gdbusauth.c b/gio/gdbusauth.c
index 14cc5d70e..8a076ce20 100644
--- a/gio/gdbusauth.c
+++ b/gio/gdbusauth.c
@@ -1348,12 +1348,9 @@ _g_dbus_auth_run_server (GDBusAuth              *auth,
                        "Not implemented (server)");
 
  out:
-  if (mech != NULL)
-    g_object_unref (mech);
-  if (dis != NULL)
-    g_object_unref (dis);
-  if (dos != NULL)
-    g_object_unref (dos);
+  g_clear_object (&mech);
+  g_clear_object (&dis);
+  g_clear_object (&dos);
 
   /* ensure return value is FALSE if error is set */
   if (error != NULL && *error != NULL)


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