mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
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:
parent
add02d8633
commit
b2e8aa5583
2 changed files with 18 additions and 14 deletions
|
@ -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];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue