[gnome-keyring/dbus-api] [gck] Reorder disposal of sessions and objects.



commit 1cd4bb0bf8d41b3d8e5d7d8e11c2f901c05e3bc7
Author: Stef Walter <stef memberwebs com>
Date:   Sun Nov 8 02:01:45 2009 +0000

    [gck] Reorder disposal of sessions and objects.
    
    Some objects still want a manager when shutting down, so leave
    manager to be the last thing to be finalized.

 pkcs11/gck/gck-module.c  |    5 ++---
 pkcs11/gck/gck-session.c |    6 +++---
 2 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/pkcs11/gck/gck-module.c b/pkcs11/gck/gck-module.c
index 08af0db..a1764b7 100644
--- a/pkcs11/gck/gck-module.c
+++ b/pkcs11/gck/gck-module.c
@@ -572,14 +572,13 @@ gck_module_dispose (GObject *obj)
 	GckModule *self = GCK_MODULE (obj);
 
 	g_hash_table_remove_all (self->pv->transient_objects);
+	g_hash_table_remove_all (self->pv->sessions_by_handle);
+	g_hash_table_remove_all (self->pv->apartments_by_id);
 
 	if (self->pv->token_manager)
 		g_object_unref (self->pv->token_manager);
 	self->pv->token_manager = NULL;
 
-	g_hash_table_remove_all (self->pv->apartments_by_id);
-	g_hash_table_remove_all (self->pv->sessions_by_handle);
-
 	g_array_set_size (self->pv->factories, 0);
 
 	G_OBJECT_CLASS (gck_module_parent_class)->dispose (obj);
diff --git a/pkcs11/gck/gck-session.c b/pkcs11/gck/gck-session.c
index 5167494..578945d 100644
--- a/pkcs11/gck/gck-session.c
+++ b/pkcs11/gck/gck-session.c
@@ -432,12 +432,12 @@ gck_session_dispose (GObject *obj)
 		self->pv->authenticator = NULL;
 	}
 
+	g_hash_table_remove_all (self->pv->objects);
+
 	if (self->pv->manager)
 		g_object_unref (self->pv->manager);
 	self->pv->manager = NULL;
-	
-	g_hash_table_remove_all (self->pv->objects);
-	
+
 	G_OBJECT_CLASS (gck_session_parent_class)->dispose (obj);
 }
 



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