vlidholt/CCBReader — pull request #10 by dumganhar (2013-01-23 08:04:29+00:00)
Title: Fixed Retain Interaction.

## Please check 1) and 2) i mentioned bellow.

- (CCNode*) nodeGraphFromData:(NSData*)d owner:(id)o parentSize:(CGSize) parentSize
.......
for (NSValue* pointerValue in animationManagers)
{
CCNode* node = [pointerValue pointerValue];

CCBAnimationManager* manager = [animationManagers objectForKey:pointerValue];
node.userObject = manager; // 1) node retains CCBAnimationManager here.

if (jsControlled)
{
[nodesWithAnimationManagers addObject:node];
[animationManagersForNodes addObject:manager];
}
}
.......

- (void) addNode:(CCNode)node andSequences:(NSDictionary)seq
{
[node retain]; 2) // CCBAnimationManager retains node here.

NSValue* nodePtr = [NSValue valueWithPointer:node];
[nodeSequences setObject:seq forKey:nodePtr];
}

I have tested it on CocosDragon, Crystal Craze and Watermelon, it works ok.
I will do it in cocos2d-x firstly. If i'm wrong, please let me know, it will revert my changes.