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

@ -1,3 +1,8 @@
2007-01-17 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSURLHandle.m: ([resourceData]) make sure value returned
is autoreleased.
2007-01-16 Nicola Pero <nicola.pero@meta-innovation.com> 2007-01-16 Nicola Pero <nicola.pero@meta-innovation.com>
* configure.ac: Fixed url of build guide given in error message * configure.ac: Fixed url of build guide given in error message

View file

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