discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: another exception triggered by OGo in gnustep-base


From: Sebastian Reitenbach
Subject: Re: another exception triggered by OGo in gnustep-base
Date: Fri, 29 Jul 2011 15:26:06 +0200
User-agent: SOGoMail 1.3.8

 
On Friday, July 29, 2011 15:00 CEST, David Chisnall <theraven@sucs.org> wrote: 
 
> On 29 Jul 2011, at 13:51, Sebastian Reitenbach wrote:
> 
> > I found this documentation here:
> > http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSData_Class/Reference/Reference.html
> > Initializes a newly allocated data object by adding to it length bytes of 
> > data from the buffer bytes.
> > 
> > but it doesn't state that a subclass should implement it???
> > 
> > SkyDecodeWrapperData is a subclass of NSData, so I should implement that 
> > method there?
> 
> I think this is a GNUstep bug.  The default implementation o 
> initWithBytesNoCopy:length:freeWhenDone: should probably be releasing self 
> and returning a new instance of the class that does support this initialiser 
> (as happens in the placeholder data class).

I looked at libFoundation SVN, there I found the following:

- (id)initWithBytesNoCopy:(void *)_bytes length:(unsigned)_length
  freeWhenDone:(BOOL)_freeMemory
{
    // new in OSX 10.2
    // TODO: inefficient for freemem==NO case
    return (_freeMemory)
        ? [self initWithBytesNoCopy:_bytes length:_length]
        : [self initWithBytes:_bytes length:_length];
}


Sebastian

> 
> David
> 
> -- Sent from my STANTEC-ZEBRA
> 
 
 
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]