Fixing a flaw I found in Vector copy constructor

_buffer wasn’t being initialized if the incoming vector had a zero size
This commit is contained in:
Stephen Gowen 2017-11-13 16:07:42 -05:00
parent 0474b5db5c
commit 9c1f7ff9bf

View File

@ -46,10 +46,8 @@ namespace Spine
// Empty
}
Vector(const Vector& inArray)
Vector(const Vector& inArray) : _size(inArray._size), _capacity(inArray._capacity), _buffer(NULL)
{
_size = inArray._size;
_capacity = inArray._capacity;
if (_capacity > 0)
{
_buffer = allocate(_capacity);