[evolution-data-server/gnome-40] gnome_online_accounts_create_client_cb: Prefer g_clear_object()
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-40] gnome_online_accounts_create_client_cb: Prefer g_clear_object()
- Date: Thu, 6 May 2021 11:48:53 +0000 (UTC)
commit d9ec385d6c53a58e0dbcd6e4d227718dc57f2b24
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]