dealloc 的水,很深?

- (void) dealloc {

   /** 1.C++ part~ */

//    _world->~b2World();

   delete_world// 经测试,delete 会调用 b2World 的析构函数~

    _world = NULL;

   delete_debugDraw//须手动去销毁,_world 析构的时候并不会将 _debugDraw 销毁~

   _debugDraw =NULL;


   /** 2.Objective-c part~ */

//    [_laserSegment dealloc];  // 详见 GameScene tick方法(已经 release 过)~

    

//    [_gameLayer removeAllChildrenWithCleanup:YES];    // CCNode 的子类对象会被自动回收,不用管~

    


   /** 3.必须的(- -,我错了,这是必须要注释掉的!!),场景切换时,先调用新场景的init方法

     * 新场景的init方法调用完之后,才会调用上一个场景的 dealloc方法~ */

//    [[BYSingle getInstance] setGameSceneWorld:NULL];

    


//    [_level dealloc]; //详见 GameScene头文件,XMLParsermm文件~

    [superdealloc];

}

@end



//GameUtil *gu = [[[GameUtil alloc] init] autorelease];

//NSString *imgFullPath = [gu saveCCRenderTextureImage:rt imgFormat:@"jpg"];

//NSLog(@"%@",imgFullPath);

//[gu writeImageToSavedPhotosAlbum:imgFullPath];






posted on 2012-02-23 16:22  yang3wei  阅读(157)  评论(0编辑  收藏  举报