From e8a3c01c362ed619b7d976e60b1a67a2a3759c31 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Tue, 18 Dec 2012 21:38:43 +0000 Subject: [PATCH] edbus: unref sent signal, also for complex types SVN revision: 81310 --- src/lib/edbus_service.c | 2 +- src/lib/edbus_service.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/edbus_service.c b/src/lib/edbus_service.c index 472d8f3..13eaad2 100644 --- a/src/lib/edbus_service.c +++ b/src/lib/edbus_service.c @@ -1247,7 +1247,6 @@ edbus_service_signal_emit(const EDBus_Service_Interface *iface, unsigned int sig EINA_SAFETY_ON_FALSE_RETURN_VAL(r, EINA_FALSE); edbus_service_signal_send(iface, sig); - edbus_message_unref(sig); return EINA_TRUE; } @@ -1257,6 +1256,7 @@ edbus_service_signal_send(const EDBus_Service_Interface *iface, EDBus_Message *s EDBUS_SERVICE_INTERFACE_CHECK_RETVAL(iface, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(signal_msg, EINA_FALSE); _edbus_connection_send(iface->obj->conn, signal_msg, NULL, NULL, -1); + edbus_message_unref(sig); return EINA_TRUE; } diff --git a/src/lib/edbus_service.h b/src/lib/edbus_service.h index c8ff1c3..ee5ead3 100644 --- a/src/lib/edbus_service.h +++ b/src/lib/edbus_service.h @@ -146,6 +146,10 @@ EAPI EDBus_Message *edbus_service_signal_new(const EDBus_Service_Interface *ifac /** * @brief Send a signal message. + * + * On success this will call edbus_message_unref() on the @param signal_msg, + * which is the intended behavior in 99% of the cases. Remember to increment + * the refcount if you want to keep it alive. */ EAPI Eina_Bool edbus_service_signal_send(const EDBus_Service_Interface *iface, EDBus_Message *signal_msg) EINA_ARG_NONNULL(1, 2); -- 2.7.4