[gnome-online-accounts] identity: Hold a ref on the identity while adding a temporary account



commit 9e1de9c3c06c8aab8358b53c3b494ce46dd7a07e
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Jan 5 17:45:31 2017 +0100

    identity: Hold a ref on the identity while adding a temporary account
    
    Otherwise, we can't be sure that the GoaIdentity will stay alive across
    the asynchronous call.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=776906

 src/goaidentity/goaidentityservice.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/goaidentity/goaidentityservice.c b/src/goaidentity/goaidentityservice.c
index aa6e552..809183a 100644
--- a/src/goaidentity/goaidentityservice.c
+++ b/src/goaidentity/goaidentityservice.c
@@ -874,7 +874,7 @@ add_temporary_account (GoaIdentityService *self,
   g_debug ("GoaIdentityService: asking to sign back in");
 
   operation_result = g_task_new (self, NULL, NULL, NULL);
-  g_task_set_task_data (operation_result, identity, NULL);
+  g_task_set_task_data (operation_result, g_object_ref (identity), g_object_unref);
 
   g_hash_table_insert (self->priv->pending_temporary_account_results,
                        g_strdup (principal),


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