开发者

Memory Leaks in Class method which consists of sqlite3_stmt object

Memory Leaks in Class method which consists of sqlite3_stmt object.

+ (PTModelObject *) processRawRow: (sqlite3_stmt *) selectStatement
{
    NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
    [formatter setDateFormat:@"yyyy-MM-dd hh:mm:ss ZZZ"];


    BBDashboard * myModelObject = [[BBDashboard alloc] init];   **128 bytes **
    [myModelObject setOid:[NSNumber numberWithInt:sqlite3_column_int(selectStatement, 0)]];

    [myModelObject setDbDate:[formatter dateFromString:[NSString stringWithFormat: @"%s",sqlite3_column_text(selectStatement, 1)]]];**32 bytes**
    [myModelObject setDbHour:[NSNumber numberWithInt:sqlite3_column_int(selectStatement, 2)]];
    [myModelObject setConsumedGoal:[NSNumber numberWithInt:sqlite3_column_int(selectStatement, 3)]];
    [myModelObject setConsumedFinal:[NSNumber numberWithInt:sqlite3_column_int(selectStatement, 4)]];
    [myModelObject setBurnedGoal:[NSNumber numberWithInt:sqlite3_col开发者_如何转开发umn_int(selectStatement, 5)]];
    [myModelObject setBurnedFinal:[NSNumber numberWithInt:sqlite3_column_int(selectStatement, 6)]];
    [myModelObject setStepsGoal:[NSNumber numberWithInt:sqlite3_column_int(selectStatement, 7)]];
    [myModelObject setStepsFinal:[NSNumber numberWithInt:sqlite3_column_int(selectStatement, 8)]];
    [myModelObject setActivityGoal:[NSNumber numberWithInt:sqlite3_column_int(selectStatement, 9)]];
    [myModelObject setActivityFinal:[NSNumber numberWithInt:sqlite3_column_int(selectStatement, 10)]];


    [formatter release];
    return [myModelObject autorelease];
}




 BBDashboard * myModelObject = [[BBDashboard alloc] init];

here it is showing 128 bytes....


from cocos2d documentation:

CCSpriteSheet is like a batch node: if it contains children, it will draw them in 1 single OpenGL call (often known as "batch draw").

A CCSpriteSheet can reference one and only one texture (one image file, one texture atlas). Only the CCSprites that are contained in that texture can be added to the CCSpriteSheet. All CCSprites added to a CCSpriteSheet are drawn in one OpenGL ES draw call. If the CCSprites are not added to a CCSpriteSheet then an OpenGL ES draw call will be needed for each one, which is less efficient.

Limitations:

The only object that is accepted as child (or grandchild, grand-grandchild, etc...) is CCSprite or any subclass of CCSprite. eg: particles, labels and layer can't be added to a CCSpriteSheet. Either all its children are Aliased or Antialiased. It can't be a mix. This is because "alias" is a property of the texture, and all the sprites share the same texture.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜