From 85192f504582891fde242c1849611ed8175068d2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Tue, 11 Dec 2012 19:51:29 +0000 Subject: [PATCH] edbus: Add ref to object and proxy in edbus_object/proxy_get MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Patch by: José Roberto de Souza SVN revision: 80704 --- legacy/edbus/src/lib/edbus_object.c | 6 +++++- legacy/edbus/src/lib/edbus_proxy.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/legacy/edbus/src/lib/edbus_object.c b/legacy/edbus/src/lib/edbus_object.c index d481d3a..6ff2450 100644 --- a/legacy/edbus/src/lib/edbus_object.c +++ b/legacy/edbus/src/lib/edbus_object.c @@ -194,7 +194,11 @@ edbus_object_get(EDBus_Connection *conn, const char *bus, const char *path) EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL); obj = edbus_connection_name_object_get(conn, bus, path); - if (obj) return obj; + if (obj) + { + edbus_object_ref(obj); + return obj; + } obj = calloc(1, sizeof(EDBus_Object)); EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL); diff --git a/legacy/edbus/src/lib/edbus_proxy.c b/legacy/edbus/src/lib/edbus_proxy.c index ba20b8f..c8ccadd 100644 --- a/legacy/edbus/src/lib/edbus_proxy.c +++ b/legacy/edbus/src/lib/edbus_proxy.c @@ -204,7 +204,11 @@ edbus_proxy_get(EDBus_Object *obj, const char *interface) EINA_SAFETY_ON_NULL_RETURN_VAL(interface, NULL); proxy = edbus_object_proxy_get(obj, interface); - if (proxy) return proxy; + if (proxy) + { + edbus_proxy_ref(proxy); + return proxy; + } proxy = calloc(1, sizeof(EDBus_Proxy)); EINA_SAFETY_ON_NULL_RETURN_VAL(proxy, NULL); -- 2.7.4