Make sure resourceData returns autoreleased copy.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24373 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2007-01-17 08:19:49 +00:00
parent add02d8633
commit b2e8aa5583
2 changed files with 18 additions and 14 deletions

View file

@ -526,24 +526,23 @@ static Class NSURLHandleClass = 0;
*/
- (NSData*) resourceData
{
if (_status == NSURLHandleLoadSucceeded)
if (_status != NSURLHandleLoadSucceeded)
{
return [self availableResourceData];
}
else if (_status == NSURLHandleLoadInProgress)
{
return nil;
}
else
{
NSData *d = [self loadInForeground];
if (d != nil)
if (_status == NSURLHandleLoadInProgress)
{
ASSIGNCOPY(_data, d);
return nil;
}
else
{
NSData *d = [self loadInForeground];
if (d != nil)
{
ASSIGNCOPY(_data, d);
}
}
return _data;
}
return [self availableResourceData];
}
/**