From 79a38d9428030028696abe2ed8c30e3f6b7c4504 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Fri, 20 Jan 2012 12:01:45 +0200 Subject: service: Add caller information to ref/unref debug prints. This helps to pin point the exact line/function who is taking the reference. --- include/service.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'include/service.h') diff --git a/include/service.h b/include/service.h index 36c86584..afa51a2c 100644 --- a/include/service.h +++ b/include/service.h @@ -89,8 +89,18 @@ enum connman_service_proxy_method { struct connman_service; struct connman_service *connman_service_create(void); -struct connman_service *connman_service_ref(struct connman_service *service); -void connman_service_unref(struct connman_service *service); + +#define connman_service_ref(service) \ + connman_service_ref_debug(service, __FILE__, __LINE__, __func__) + +#define connman_service_unref(service) \ + connman_service_unref_debug(service, __FILE__, __LINE__, __func__) + +struct connman_service * +connman_service_ref_debug(struct connman_service *service, + const char *file, int line, const char *caller); +void connman_service_unref_debug(struct connman_service *service, + const char *file, int line, const char *caller); enum connman_service_type connman_service_get_type(struct connman_service *service); char *connman_service_get_interface(struct connman_service *service); -- cgit v1.2.3