SGVector<>* is weird, which may cause some memory problems. Try DynamicArray instead.