[gnome-online-accounts] Use g_clear_object wherever applicable
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-accounts] Use g_clear_object wherever applicable
- Date: Fri, 13 Jun 2014 14:54:44 +0000 (UTC)
commit 3a93d0fcd67c69cc218265177e46fd8c0d063620
Author: Debarshi Ray <debarshir gnome org>
Date: Fri Jun 13 13:42:22 2014 +0200
Use g_clear_object wherever applicable
src/goabackend/goafacebookprovider.c | 15 +++++----------
src/goabackend/goaflickrprovider.c | 6 ++----
src/goabackend/goagoogleprovider.c | 6 ++----
src/goabackend/goapocketprovider.c | 6 ++----
src/goabackend/goawindowsliveprovider.c | 9 +++------
src/goabackend/goayahooprovider.c | 6 ++----
6 files changed, 16 insertions(+), 32 deletions(-)
---
diff --git a/src/goabackend/goafacebookprovider.c b/src/goabackend/goafacebookprovider.c
index 57ac814..93e326b 100644
--- a/src/goabackend/goafacebookprovider.c
+++ b/src/goabackend/goafacebookprovider.c
@@ -270,14 +270,11 @@ get_identity_sync (GoaOAuth2Provider *provider,
out:
g_clear_error (&identity_error);
+ g_clear_object (&call);
+ g_clear_object (&parser);
+ g_clear_object (&proxy);
g_free (id);
g_free (presentation_identity);
- if (parser != NULL)
- g_object_unref (parser);
- if (call != NULL)
- g_object_unref (call);
- if (proxy != NULL)
- g_object_unref (proxy);
return ret;
}
@@ -435,10 +432,8 @@ build_object (GoaProvider *provider,
ret = TRUE;
out:
- if (chat != NULL)
- g_object_unref (chat);
- if (account != NULL)
- g_object_unref (account);
+ g_clear_object (&chat);
+ g_clear_object (&account);
g_clear_object (&photos);
g_clear_object (&maps);
return ret;
diff --git a/src/goabackend/goaflickrprovider.c b/src/goabackend/goaflickrprovider.c
index 152bdc4..0c7f31a 100644
--- a/src/goabackend/goaflickrprovider.c
+++ b/src/goabackend/goaflickrprovider.c
@@ -255,12 +255,10 @@ get_identity_sync (GoaOAuthProvider *provider,
out:
g_clear_error (&identity_error);
+ g_clear_object (&call);
+ g_clear_object (&proxy);
g_free (id);
g_free (presentation_identity);
- if (call != NULL)
- g_object_unref (call);
- if (proxy != NULL)
- g_object_unref (proxy);
return ret;
}
diff --git a/src/goabackend/goagoogleprovider.c b/src/goabackend/goagoogleprovider.c
index 5f499d0..7cc8ff5 100644
--- a/src/goabackend/goagoogleprovider.c
+++ b/src/goabackend/goagoogleprovider.c
@@ -255,11 +255,9 @@ get_identity_sync (GoaOAuth2Provider *provider,
out:
g_clear_error (&identity_error);
+ g_clear_object (&call);
+ g_clear_object (&proxy);
g_free (email);
- if (call != NULL)
- g_object_unref (call);
- if (proxy != NULL)
- g_object_unref (proxy);
return ret;
}
diff --git a/src/goabackend/goapocketprovider.c b/src/goabackend/goapocketprovider.c
index 13aabb1..4056471 100644
--- a/src/goabackend/goapocketprovider.c
+++ b/src/goabackend/goapocketprovider.c
@@ -394,10 +394,8 @@ build_object (GoaProvider *provider,
ret = TRUE;
out:
- if (readlater != NULL)
- g_object_unref (readlater);
- if (account != NULL)
- g_object_unref (account);
+ g_clear_object (&readlater);
+ g_clear_object (&account);
return ret;
}
diff --git a/src/goabackend/goawindowsliveprovider.c b/src/goabackend/goawindowsliveprovider.c
index 44cd128..9be1f4f 100644
--- a/src/goabackend/goawindowsliveprovider.c
+++ b/src/goabackend/goawindowsliveprovider.c
@@ -243,12 +243,10 @@ get_identity_sync (GoaOAuth2Provider *provider,
out:
g_clear_error (&identity_error);
+ g_clear_object (&call);
+ g_clear_object (&proxy);
g_free (id);
g_free (presentation_identity);
- if (call != NULL)
- g_object_unref (call);
- if (proxy != NULL)
- g_object_unref (proxy);
return ret;
}
@@ -397,8 +395,7 @@ build_object (GoaProvider *provider,
out:
g_clear_object (&documents);
g_clear_object (&mail);
- if (account != NULL)
- g_object_unref (account);
+ g_clear_object (&account);
return ret;
}
diff --git a/src/goabackend/goayahooprovider.c b/src/goabackend/goayahooprovider.c
index 203bc51..586ede3 100644
--- a/src/goabackend/goayahooprovider.c
+++ b/src/goabackend/goayahooprovider.c
@@ -304,12 +304,10 @@ get_identity_sync (GoaOAuthProvider *provider,
out:
g_clear_error (&identity_error);
+ g_clear_object (&call);
+ g_clear_object (&proxy);
g_free (presentation_identity);
g_free (guid);
- if (call != NULL)
- g_object_unref (call);
- if (proxy != NULL)
- g_object_unref (proxy);
return ret;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]