[evolution-data-server/gnome-3-8] Add source_registry_dbus_object_dup_uid().
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-3-8] Add source_registry_dbus_object_dup_uid().
- Date: Thu, 2 May 2013 12:56:19 +0000 (UTC)
commit bf4e08ce4ea6e39ebe3380532b2d9277a16cb971
Author: Matthew Barnes <mbarnes redhat com>
Date: Tue Apr 30 13:45:44 2013 -0400
Add source_registry_dbus_object_dup_uid().
Handy internal utility for ESourceRegistry.
This also happens to fix an EDBusSource reference leak in
source_registry_create_sources_object_added_cb().
(cherry picked from commit e3ea6473316091a5ed9f8a333f584dda277a2404)
libedataserver/e-source-registry.c | 26 +++++++++++++++++++-------
1 files changed, 19 insertions(+), 7 deletions(-)
---
diff --git a/libedataserver/e-source-registry.c b/libedataserver/e-source-registry.c
index bfcdfce..4644826 100644
--- a/libedataserver/e-source-registry.c
+++ b/libedataserver/e-source-registry.c
@@ -281,6 +281,19 @@ thread_closure_free (ThreadClosure *closure)
g_slice_free (ThreadClosure, closure);
}
+static gchar *
+source_registry_dbus_object_dup_uid (GDBusObject *dbus_object)
+{
+ EDBusObject *e_dbus_object;
+ EDBusSource *e_dbus_source;
+
+ /* EDBusSource interface should always be present. */
+ e_dbus_object = E_DBUS_OBJECT (dbus_object);
+ e_dbus_source = e_dbus_object_peek_source (e_dbus_object);
+
+ return e_dbus_source_dup_uid (e_dbus_source);
+}
+
static void
source_registry_object_path_table_insert (ESourceRegistry *registry,
const gchar *object_path,
@@ -2152,15 +2165,14 @@ source_registry_create_sources_object_added_cb (GDBusObjectManager *object_manag
GDBusObject *dbus_object,
CreateContext *create_context)
{
- EDBusObject *e_dbus_object;
- EDBusSource *e_dbus_source;
- const gchar *uid;
+ gchar *uid;
- e_dbus_object = E_DBUS_OBJECT (dbus_object);
- e_dbus_source = e_dbus_object_get_source (e_dbus_object);
- uid = e_dbus_source_get_uid (e_dbus_source);
+ uid = source_registry_dbus_object_dup_uid (dbus_object);
- g_hash_table_remove (create_context->pending_uids, uid);
+ if (uid != NULL) {
+ g_hash_table_remove (create_context->pending_uids, uid);
+ g_free (uid);
+ }
/* The hash table will be empty when all of the expected
* GDBusObjects have been added to the GDBusObjectManager. */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]