Attempts to prevent leak warnings from static analyser

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32090 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2011-02-12 06:51:42 +00:00
parent 3f94a2ef6b
commit c7bb84decb
9 changed files with 98 additions and 5 deletions

View file

@ -790,6 +790,16 @@ static NSNotificationCenter *default_center = nil;
*/
name = [name copyWithZone: NSDefaultMallocZone()];
GSIMapAddPair(NAMED, (GSIMapKey)(id)name, (GSIMapVal)(void*)m);
#ifdef __clang__
{
/* We store the object in 'dummy' for no other purpose than to silence
* the clang static analyser's warning that we are leaking memory, which
* occurs because it doesn't realise that the object was already stored
* later deallocation.
*/
gsPrivateDummy = name;
}
#endif
}
else
{