[evolution-data-server] ESourceRegistry: object_path_table cleanups.



commit 995aff9ca6760b5c0700b1250ea6064110864908
Author: Matthew Barnes <mbarnes redhat com>
Date:   Tue Apr 30 13:52:19 2013 -0400

    ESourceRegistry: object_path_table cleanups.

 libedataserver/e-source-registry.c |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/libedataserver/e-source-registry.c b/libedataserver/e-source-registry.c
index 7a6a94b..1700045 100644
--- a/libedataserver/e-source-registry.c
+++ b/libedataserver/e-source-registry.c
@@ -298,13 +298,17 @@ source_registry_object_path_table_insert (ESourceRegistry *registry,
                                           const gchar *object_path,
                                           ESource *source)
 {
+       GHashTable *object_path_table;
+
        g_return_if_fail (object_path != NULL);
        g_return_if_fail (E_IS_SOURCE (source));
 
+       object_path_table = registry->priv->object_path_table;
+
        g_mutex_lock (&registry->priv->object_path_table_lock);
 
        g_hash_table_insert (
-               registry->priv->object_path_table,
+               object_path_table,
                g_strdup (object_path),
                g_object_ref (source));
 
@@ -315,14 +319,16 @@ static ESource *
 source_registry_object_path_table_lookup (ESourceRegistry *registry,
                                           const gchar *object_path)
 {
+       GHashTable *object_path_table;
        ESource *source;
 
        g_return_val_if_fail (object_path != NULL, NULL);
 
+       object_path_table = registry->priv->object_path_table;
+
        g_mutex_lock (&registry->priv->object_path_table_lock);
 
-       source = g_hash_table_lookup (
-               registry->priv->object_path_table, object_path);
+       source = g_hash_table_lookup (object_path_table, object_path);
        if (source != NULL)
                g_object_ref (source);
 
@@ -335,14 +341,16 @@ static gboolean
 source_registry_object_path_table_remove (ESourceRegistry *registry,
                                           const gchar *object_path)
 {
+       GHashTable *object_path_table;
        gboolean removed;
 
        g_return_val_if_fail (object_path != NULL, FALSE);
 
+       object_path_table = registry->priv->object_path_table;
+
        g_mutex_lock (&registry->priv->object_path_table_lock);
 
-       removed = g_hash_table_remove (
-               registry->priv->object_path_table, object_path);
+       removed = g_hash_table_remove (object_path_table, object_path);
 
        g_mutex_unlock (&registry->priv->object_path_table_lock);
 


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