[Insight-users] destruction of itk objects

John Biddiscombe John Biddiscombe" <jbiddiscombe@skippingmouse.co.uk
Thu, 13 Feb 2003 15:42:36 -0000


Dean

> typedef itk::Image<float, 2> ImageType;
> typedef itk::VTKImageImport<ImageType> ImageImportType;
> ImageImportType::Pointer itkImporter;
>
> instantiates it in the OnCreate event:

At the end of the OnCreate itImporter gets destroyed because it's out of
scope

add
itkImporter->Register()

and in OnDestroy put
itkImporter->UnRegister()

to make sure it "exists" in between

JB