[epiphany/wip/ephy-sync: 49/86] sync-service: Get rid of object references in dispose



commit e225fa34da7cc54b972ba8bb81590fa2537d8fda
Author: Gabriel Ivascu <ivascu gabriel59 gmail com>
Date:   Fri Jul 22 18:36:38 2016 +0300

    sync-service: Get rid of object references in dispose

 src/ephy-sync-service.c |   29 +++++++++++++++++------------
 1 files changed, 17 insertions(+), 12 deletions(-)
---
diff --git a/src/ephy-sync-service.c b/src/ephy-sync-service.c
index caf6492..45b8e96 100644
--- a/src/ephy-sync-service.c
+++ b/src/ephy-sync-service.c
@@ -388,29 +388,34 @@ ephy_sync_service_finalize (GObject *object)
 {
   EphySyncService *self = EPHY_SYNC_SERVICE (object);
 
-  g_free (self->uid);
-  g_free (self->sessionToken);
-  g_free (self->keyFetchToken);
-  g_free (self->unwrapBKey);
-  g_free (self->kA);
-  g_free (self->kB);
-  g_free (self->user_email);
-  g_free (self->certificate);
-  g_free (self->storage_endpoint);
-  g_free (self->token_server_id);
-  g_free (self->token_server_key);
-  g_clear_object (&self->soup_session);
   ephy_sync_crypto_rsa_key_pair_free (self->keypair);
 
   G_OBJECT_CLASS (ephy_sync_service_parent_class)->finalize (object);
 }
 
 static void
+ephy_sync_service_dispose (GObject *object)
+{
+  EphySyncService *self = EPHY_SYNC_SERVICE (object);
+
+  g_clear_object (&self->soup_session);
+  g_clear_pointer (&self->user_email, g_free);
+  g_clear_pointer (&self->certificate, g_free);
+  g_clear_pointer (&self->storage_endpoint, g_free);
+  g_clear_pointer (&self->token_server_id, g_free);
+  g_clear_pointer (&self->token_server_key, g_free);
+  ephy_sync_service_delete_all_tokens (self);
+
+  G_OBJECT_CLASS (ephy_sync_service_parent_class)->dispose (object);
+}
+
+static void
 ephy_sync_service_class_init (EphySyncServiceClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
   object_class->finalize = ephy_sync_service_finalize;
+  object_class->dispose = ephy_sync_service_dispose;
 }
 
 static void


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