modify the logic of "node" method

This commit is contained in:
Walzer 2010-10-01 15:04:12 +00:00
parent 61ccb9f59e
commit ed4e288f27
2 changed files with 38 additions and 32 deletions

View File

@ -65,8 +65,11 @@ CCLayer *CCLayer::node()
pRet->autorelease(); pRet->autorelease();
return pRet; return pRet;
} }
CCX_SAFE_DELETE(pRet) else
return NULL; {
CCX_SAFE_DELETE(pRet)
return NULL;
}
} }
/// Touch and Accelerometer related /// Touch and Accelerometer related

View File

@ -61,7 +61,10 @@ CCScene *CCScene::node()
pRet->autorelease(); pRet->autorelease();
return pRet; return pRet;
} }
CCX_SAFE_DELETE(pRet) else
return NULL; {
CCX_SAFE_DELETE(pRet)
return NULL;
}
} }
}//namespace cocos2d }//namespace cocos2d