cocos2d/cocos2d-x — pull request #5428 by dumganhar (2014-02-21 03:26:46+00:00)
Title: closed #4106: Object which isn't in Vector would also be released when invoking Vector::eraseObject.

Also refactored 'Vector::eraseObject':
* Removed 'toRelease' parameter, Vector class should manage reference count.
* Added 'removeAll' parameter to decide wether to remove all elements with the same value or just the first occurrence .
* Added relevant UnitTest for 'Vector::eraseObject'.

Ref's destructor should be protected.