mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +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
|
@ -616,6 +616,17 @@ static IMP _xRefImp; /* Serialize a crossref. */
|
|||
obj = rep;
|
||||
GSIArraySetItemAtIndex(_objAry, (GSIArrayItem)obj, xref);
|
||||
}
|
||||
#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 = rep;
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
*(id*)address = obj;
|
||||
|
@ -723,6 +734,16 @@ static IMP _xRefImp; /* Serialize a crossref. */
|
|||
*/
|
||||
address = &dummy;
|
||||
(*_dTagImp)(_src, dTagSel, &info, &xref, &_cursor);
|
||||
#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 = classInfo;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if (info != _GSC_NONE)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue