[evolution-data-server] gnome_online_accounts_create_client_cb: Prefer g_clear_object()



commit 5b3912a4752e508f21b5e9fb7cb0382c8c57008c
Author: Milan Crha <mcrha redhat com>
Date:   Thu May 6 13:38:29 2021 +0200

    gnome_online_accounts_create_client_cb: Prefer g_clear_object()
    
    The cancellable could be NULL, in which case a runtime warning is
    printed on the console. There's the g_clear_object(), which helps
    in this situation.

 src/modules/gnome-online-accounts/module-gnome-online-accounts.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/src/modules/gnome-online-accounts/module-gnome-online-accounts.c 
b/src/modules/gnome-online-accounts/module-gnome-online-accounts.c
index 3f09a5f23..03c4930f5 100644
--- a/src/modules/gnome-online-accounts/module-gnome-online-accounts.c
+++ b/src/modules/gnome-online-accounts/module-gnome-online-accounts.c
@@ -1258,8 +1258,7 @@ gnome_online_accounts_create_client_cb (GObject *source_object,
        extension->goa_client = goa_client;  /* takes ownership */
 
        /* Don't need the GCancellable anymore. */
-       g_object_unref (extension->create_client);
-       extension->create_client = NULL;
+       g_clear_object (&extension->create_client);
 
        list = e_goa_client_list_accounts (extension->goa_client);
 


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