service: Add ref counting debug
authorJukka Rissanen <jukka.rissanen@linux.intel.com>
Wed, 18 Jan 2012 14:46:33 +0000 (16:46 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Fri, 20 Jan 2012 00:42:07 +0000 (01:42 +0100)
src/service.c

index 9d5820f..4789065 100644 (file)
@@ -3446,7 +3446,7 @@ void __connman_service_put(struct connman_service *service)
 {
        GSequenceIter *iter;
 
-       DBG("service %p", service);
+       DBG("service %p ref %d", service, service->refcount - 1);
 
        if (__sync_fetch_and_sub(&service->refcount, 1) != 1)
                return;
@@ -3560,7 +3560,7 @@ struct connman_service *connman_service_create(void)
  */
 struct connman_service *connman_service_ref(struct connman_service *service)
 {
-       DBG("%p", service);
+       DBG("%p ref %d", service, service->refcount + 1);
 
        __sync_fetch_and_add(&service->refcount, 1);