gujjula / core-plot

Automatically exported from code.google.com/p/core-plot
0 stars 0 forks source link

[CPTNumericData mutableCopy] returns non-mutable #305

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Here's the relevant code from CPTNumericData: 
-(id)mutableCopyWithZone:(NSZone *)zone 
{
    if ( NSShouldRetainWithZone(self, zone)) {
        return [self retain];
    }

    return [[CPTMutableNumericData allocWithZone:zone] initWithData:self.data
                                                                                                                  dataType:self.dataType
                                                             shape:self.shape];
}

I don't think this is correct, and I'm getting a bug when I try calling 
mutableCopy on a non-mutable CPTNumericData. mutableCopy shouldn't ever return 
[self retain], should it? The crash occurs when [CPTPlot 
numericDataForNumbers:] tries to call setDataType: on what it thinks is a 
mutable object.

Original issue reported on code.google.com by davidgri...@gmail.com on 18 Jul 2011 at 5:24

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 4ee699caab55.

Original comment by eskr...@mac.com on 19 Jul 2011 at 2:31