This one has me baffled honestly. Seems the autorelease pool is releasing an object twice :
Now, this object is a NSString that's a property of an instance of a class. The property is declared as such :
Also, it says one of my Class functions is releasing this string. However, there is no release statement at all in that function, it's quite the small utility type function to begin with :
This is how it's being called in code if I follow the stack :
And this is how the string value was initially set in the property :
I hope this is a very stupid mistake on my part.
EDIT : wait, could it be because I'm not using the synthesized property and thus not issuing a retain on the NSString when grabbing it from the NSDictionary in that last code block ?
EDIT2: god damn it, that was it
Now, this object is a NSString that's a property of an instance of a class. The property is declared as such :
Code:
@property (nonatomic, retain) NSString * colorSet;
Also, it says one of my Class functions is releasing this string. However, there is no release statement at all in that function, it's quite the small utility type function to begin with :
Code:
+(NSDictionary *) getColorSetNamed: (NSString *) colorSetName
{
return csIsReady ? [colorSets objectForKey: colorSetName] : nil;
}
This is how it's being called in code if I follow the stack :
Code:
int numElements = [sprites count];
...
BRSprite * currentSprite;
...
for(int i = 0; i < numElements; i++)
{
currentSprite = [sprites objectAtIndex: i];
...
NSDictionary * currentColorSet = nil;
...
if(currentSprite.colorSet)
currentColorSet = [BRColorSet getColorSetNamed: currentSprite.colorSet];
And this is how the string value was initially set in the property :
Code:
NSDictionary * colorSetConfig;
if((colorSetConfig = [defaults objectForKey: @"colorset"]))
{
colorSet = [colorSetConfig objectForKey:@"default"];
I hope this is a very stupid mistake on my part.
EDIT : wait, could it be because I'm not using the synthesized property and thus not issuing a retain on the NSString when grabbing it from the NSDictionary in that last code block ?
EDIT2: god damn it, that was it
Last edited: