Return to Cocos2d Playback Library

mem leak

Questions related to Cocos2d playback library should be asked here.

mem leak

Postby Shenghua Su » April 15th, 2014, 12:24 am

in GAFLoader.mm method:

void GAFLoader::_registerTagLoaders()
{
m_tagLoaders[Tags::TagDefineAtlas] = new TagDefineAtlas();
m_tagLoaders[Tags::TagDefineAnimationMasks] = new TagDefineAnimationMasks();
m_tagLoaders[Tags::TagDefineAnimationObjects] = new TagDefineAnimationObjects();
m_tagLoaders[Tags::TagDefineAnimationFrames] = new TagDefineAnimationFrames();
m_tagLoaders[Tags::TagDefineNamedParts] = new TagDefineNamedParts();
m_tagLoaders[Tags::TagDefineNamedParts] = new TagDefineNamedParts(); // memory leak by repeated allocation
m_tagLoaders[Tags::TagDefineSequences] = new TagDefineSequences();
}
User avatar
Shenghua Su
 
Posts: 6
Joined: March 11th, 2014, 1:06 am

Re: mem leak

Postby Shenghua Su » April 15th, 2014, 12:37 am

in GAFAsset.mm method:

"- (id) initWithGAFFileData:(NSData*)aGAFFileData ..." and "- (id) initWithGAFFile:(NSString*) ..."

{
self = [super init];

self.textureAtlases = [NSMutableArray array];
self.animationObjects = [NSMutableDictionary dictionary];
self.animationMasks = [NSMutableDictionary dictionary];
self.animationFrames = [NSMutableArray array];
self.animationSequences = [NSMutableDictionary dictionary];

GAFLoader* loader = new GAFLoader(); // not paired with delete

bool isLoaded = loader->loadFile(aGAFFileData, self);

if (isLoaded)
{
isLoaded &= [self loadTextures:anAtlasTexturesFolder];
}

if (isLoaded)
return self;
else
return nil;
}
User avatar
Shenghua Su
 
Posts: 6
Joined: March 11th, 2014, 1:06 am

Re: mem leak

Postby Timur Losev » April 15th, 2014, 1:31 am

Shenghua Su wrote:in GAFAsset.mm method:

"- (id) initWithGAFFileData:(NSData*)aGAFFileData ..." and "- (id) initWithGAFFile:(NSString*) ..."

{
self = [super init];

self.textureAtlases = [NSMutableArray array];
self.animationObjects = [NSMutableDictionary dictionary];
self.animationMasks = [NSMutableDictionary dictionary];
self.animationFrames = [NSMutableArray array];
self.animationSequences = [NSMutableDictionary dictionary];

GAFLoader* loader = new GAFLoader(); // not paired with delete

bool isLoaded = loader->loadFile(aGAFFileData, self);

if (isLoaded)
{
isLoaded &= [self loadTextures:anAtlasTexturesFolder];
}

if (isLoaded)
return self;
else
return nil;
}



yeah, thanks, fixed
User avatar
Timur Losev
 
Posts: 70
Joined: January 9th, 2014, 7:30 am

Return to Cocos2d Playback Library

Who is online

Users browsing this forum: No registered users and 1 guest