If you need to allocate it on the heap at all, stack-allocated objects are destroyed when they leave the local scope.