Closed zhaijialong closed 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.
new
if (_ccobj)
_ccobj
new (std::nothrow)
@minggo Please review it and my other 3 PRs. Thank you very much.
For the normal
new
, there is no sense for the check ofif (_ccobj)
. If memory alloc failed, it will generate a exception rather than returns NULL, and the_ccobj
will never be NULL. If we usenew (std::nothrow)
, this check will work correctly.