[evolution-data-server] Bug #681046 - Occasional crash of evolution-source-registry



commit 0f27bc039d2744d29405de94fd0081788f02863a
Author: Milan Crha <mcrha redhat com>
Date:   Wed Aug 8 08:52:24 2012 +0200

    Bug #681046 - Occasional crash of evolution-source-registry

 libebackend/e-authentication-session.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/libebackend/e-authentication-session.c b/libebackend/e-authentication-session.c
index 4f3a0f1..75b3f77 100644
--- a/libebackend/e-authentication-session.c
+++ b/libebackend/e-authentication-session.c
@@ -122,6 +122,8 @@ G_DEFINE_TYPE (
 	e_authentication_session,
 	G_TYPE_OBJECT)
 
+G_LOCK_DEFINE_STATIC (gnome_keyring);
+
 static void
 async_context_free (AsyncContext *async_context)
 {
@@ -1311,6 +1313,8 @@ e_authentication_session_store_password_sync (EAuthenticationSession *session,
 	uid = e_authentication_session_get_source_uid (session);
 	display_name = g_strdup_printf (KEYRING_ITEM_DISPLAY_FORMAT, uid);
 
+	G_LOCK (gnome_keyring);
+
 	result = gnome_keyring_store_password_sync (
 		&schema, keyring, display_name, password,
 		KEYRING_ITEM_ATTRIBUTE_NAME, uid, NULL);
@@ -1327,6 +1331,8 @@ e_authentication_session_store_password_sync (EAuthenticationSession *session,
 			result, gnome_keyring_result_to_message (result));
 	}
 
+	G_UNLOCK (gnome_keyring);
+
 	g_free (display_name);
 
 	return (result == GNOME_KEYRING_RESULT_OK);
@@ -1478,6 +1484,8 @@ e_authentication_session_lookup_password_sync (EAuthenticationSession *session,
 
 	uid = e_authentication_session_get_source_uid (session);
 
+	G_LOCK (gnome_keyring);
+
 	result = gnome_keyring_find_password_sync (
 		&schema, &temp, KEYRING_ITEM_ATTRIBUTE_NAME, uid, NULL);
 
@@ -1510,6 +1518,8 @@ e_authentication_session_lookup_password_sync (EAuthenticationSession *session,
 	if (temp != NULL)
 		gnome_keyring_free_password (temp);
 
+	G_UNLOCK (gnome_keyring);
+
 	return (result == GNOME_KEYRING_RESULT_OK);
 }
 
@@ -1659,6 +1669,8 @@ e_authentication_session_delete_password_sync (EAuthenticationSession *session,
 
 	uid = e_authentication_session_get_source_uid (session);
 
+	G_LOCK (gnome_keyring);
+
 	result = gnome_keyring_delete_password_sync (
 		&schema, KEYRING_ITEM_ATTRIBUTE_NAME, uid, NULL);
 
@@ -1678,6 +1690,8 @@ e_authentication_session_delete_password_sync (EAuthenticationSession *session,
 			result, gnome_keyring_result_to_message (result));
 	}
 
+	G_UNLOCK (gnome_keyring);
+
 	return (result == GNOME_KEYRING_RESULT_OK);
 }
 



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