From 182fa71ff320072fefa1dd8ea260e5a38de67723 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Wed, 4 Nov 2015 07:38:50 +0000 Subject: [PATCH] improve diagnostic log git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/sqlclient/trunk@39138 72102866-910b-0410-8b05-ffd578937521 --- SQLClientPool.m | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/SQLClientPool.m b/SQLClientPool.m index f01cf05..26c259c 100644 --- a/SQLClientPool.m +++ b/SQLClientPool.m @@ -912,15 +912,30 @@ static Class cls = Nil; unsigned long rc; unsigned long ac; + unsigned long uc; + int index; if (Nil == cls) { cls = [NSAutoreleasePool class]; } + rc = (unsigned long)[o retainCount]; ac = (unsigned long)[cls autoreleaseCountForObject: o]; - return [NSString stringWithFormat: @" refs %ld (%lu-%lu)", - rc - ac, rc, ac]; + [_lock lock]; + uc = 0; + for (index = 0; index < _max; index++) + { + if (o == _items[index].c) + { + uc = _items[index].u; + break; + } + } + [self _unlock]; + return [NSString stringWithFormat: + @" provided %ld times (retained:%lu - autoreleased:%lu)", + uc, rc, ac]; } #endif return @"";