mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
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:
parent
3f94a2ef6b
commit
c7bb84decb
9 changed files with 98 additions and 5 deletions
|
@ -460,6 +460,18 @@ unregisterActiveThread(NSThread *thread)
|
|||
t = [self new];
|
||||
t->_active = YES;
|
||||
pthread_setspecific(thread_object_key, t);
|
||||
|
||||
#ifdef __clang__
|
||||
{
|
||||
/* We store the thread 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 pthread_setspecific() stores
|
||||
* the thread for later deallocation.
|
||||
*/
|
||||
gsPrivateDummy = t;
|
||||
}
|
||||
#endif
|
||||
|
||||
return YES;
|
||||
}
|
||||
return NO;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue