diff --git a/HelloWorld/HelloWorldApp.cpp b/HelloWorld/HelloWorldApp.cpp index a77e030d4e..a5dd8b6fc2 100644 --- a/HelloWorld/HelloWorldApp.cpp +++ b/HelloWorld/HelloWorldApp.cpp @@ -28,9 +28,9 @@ bool THelloWorldApp::initCocos2d() CGSize size = CCDirector::getSharedDirector()->getWinSize(); // create sprite instance - CCSprite * pSprite = (new CCSprite())->initWithTexture(pTexture); + CCSprite * pSprite = new CCSprite(); + pSprite->initWithTexture(pTexture); pSprite->setPosition(CGPoint(size.width / 2, size.height / 2)); - pSprite->autorelease()->retain(); // create layer instance CCLayer * pLayer = new CCLayer();