Memory management fixes

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@16421 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2003-04-10 18:15:53 +00:00
parent a18e9de578
commit 856e8a4598
3 changed files with 9 additions and 19 deletions

View file

@ -1759,10 +1759,6 @@ static void retDecoder(DOContext *ctxt)
else
{
[coder decodeValueOfObjCType: type at: ctxt->datum];
if ((*type == _C_CHARPTR || *type == _C_PTR) && *(void**)ctxt->datum != 0)
{
[NSData dataWithBytesNoCopy: *(void**)ctxt->datum length: 1];
}
}
}
@ -2303,19 +2299,7 @@ static void callDecoder (DOContext *ctxt)
}
else
{
void *datum = ctxt->datum;
[ctxt->decoder decodeValueOfObjCType: type at: datum];
/*
* -decodeValueOfObjCType:at: malloc's new memory
* for pointers. We need to make sure it gets freed eventually
* so we don't have a memory leak. Request here that it be
* autorelease'ed.
*/
if ((*type == _C_CHARPTR || *type == _C_PTR) && *(void**)datum != 0)
{
[NSData dataWithBytesNoCopy: *(void**)datum length: 1];
}
[ctxt->decoder decodeValueOfObjCType: type at: ctxt->datum];
}
}