issue #4106: Ref class's constructor should be protected.
closed #4106: Object which isn't in Vector would also be released when invoking Vector::eraseObject.
Also refactored 'Vector::eraseObject':
1) Removed 'toRelease' parameter, Vector class should manage reference count.
2) Added 'removeAll' parameter to decide wether to remove all elements with the same value or just the first occurrence .
3) Added relevant UnitTest for 'Vector::eraseObject'.
issue #4106: Updates comments for 'Vector::eraseObject'
Merge pull request #5428 from dumganhar/iss4106-vector-eraseObject

closed #4106: Object which isn't in Vector would also be released when invoking Vector::eraseObject.