Fixed memory leak when setting the the vertices and indices in Primitive.