cocos2d / bindings-generator

JSBindings generator for C++
170 stars 153 forks source link

use nothrow-new instead of new in js bindings #129

Closed zhaijialong closed 10 years ago

zhaijialong commented 10 years ago

For the normal new, there is no sense for the check of if (_ccobj). If memory alloc failed, it will generate a exception rather than returns NULL, and the _ccobj will never be NULL. If we use new (std::nothrow) , this check will work correctly.

zhaijialong commented 10 years ago

@minggo Please review it and my other 3 PRs. Thank you very much.