I create a vtkSmartPointer as a class variable and initialize it using:
imageStack = vtkSmartPointer<vtkImageData>::New();
would imageStack (a class variable) be allocated on the heap or the stack? I've read this post about using variable = new Object(); being on the heap, but is using ::New() any different?
Also, if imageStack is already pointing to memory with data in it, and I over write it by doing:
imageStack = vtkSmartPointer<vtkImageData>::New();
is it freeing the old memory it was pointing to prior? This post leads me to believe it is, but I still seem to be getting a stack overflow.