add functiononappterminate
Merge branch 'master' of github.com:saranpol/cocos2d-x