[gnome-online-accounts/gnome-3-18] kerberos: Do not use goa_object_peek_* in threaded code
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-accounts/gnome-3-18] kerberos: Do not use goa_object_peek_* in threaded code
- Date: Thu, 14 Jul 2016 15:56:16 +0000 (UTC)
commit 9445774246b1fd6533f42cb8bd0ef30f1ba6084c
Author: Debarshi Ray <debarshir gnome org>
Date: Tue Feb 16 17:09:19 2016 +0100
kerberos: Do not use goa_object_peek_* in threaded code
https://bugzilla.gnome.org/show_bug.cgi?id=762155
src/goabackend/goakerberosprovider.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/src/goabackend/goakerberosprovider.c b/src/goabackend/goakerberosprovider.c
index 5f1b241..da20fcc 100644
--- a/src/goabackend/goakerberosprovider.c
+++ b/src/goabackend/goakerberosprovider.c
@@ -267,7 +267,7 @@ get_ticket_sync (GoaKerberosProvider *self,
GCancellable *cancellable,
GError **error)
{
- GVariant *credentials;
+ GVariant *credentials = NULL;
GError *lookup_error;
GError *sign_in_error;
GoaAccount *account;
@@ -281,7 +281,7 @@ get_ticket_sync (GoaKerberosProvider *self,
ret = FALSE;
- account = goa_object_peek_account (object);
+ account = goa_object_get_account (object);
identifier = goa_account_get_identity (account);
ticketing = goa_object_get_ticketing (object);
@@ -291,7 +291,7 @@ get_ticket_sync (GoaKerberosProvider *self,
GOA_ERROR,
GOA_ERROR_NOT_SUPPORTED,
_("Ticketing is disabled for account"));
- return FALSE;
+ goto out;
}
details = goa_ticketing_get_details (ticketing);
@@ -350,6 +350,7 @@ get_ticket_sync (GoaKerberosProvider *self,
ret = TRUE;
out:
+ g_clear_object (&account);
g_clear_object (&ticketing);
g_free (object_path);
g_clear_pointer (&credentials, (GDestroyNotify) g_variant_unref);
@@ -1361,14 +1362,14 @@ ensure_credentials_sync (GoaProvider *provider,
GError **error)
{
GoaIdentityServiceIdentity *identity = NULL;
- GoaAccount *account;
+ GoaAccount *account = NULL;
const char *identifier;
gint64 timestamp;
GDateTime *now, *expiration_time;
GTimeSpan time_span;
gboolean credentials_ensured = FALSE;
- account = goa_object_peek_account (object);
+ account = goa_object_get_account (object);
identifier = goa_account_get_identity (account);
ensure_identity_manager ();
@@ -1437,6 +1438,7 @@ ensure_credentials_sync (GoaProvider *provider,
g_date_time_unref (expiration_time);
out:
+ g_clear_object (&account);
g_clear_object (&identity);
g_mutex_unlock (&identity_manager_mutex);
return credentials_ensured;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]