[Insight-users] memory management question
Jens Eickmeyer
eickmeyer at gmail.com
Mon Mar 7 16:18:53 EST 2005
Thanks for the quick reply. Your solution did the trick.
Jens
On Mon, 07 Mar 2005 12:48:34 -0500, Julien Jomier <jjomier at cs.unc.edu> wrote:
> Hi Jens,
>
> You can assign the image to a NULL pointer.
> This should dereference the pointer and destroy the data.
>
> It's always risky to change the reference count of smart pointers by hand.
>
> Julien
>
> Jens Eickmeyer wrote:
> > Hi!
> >
> > Can anyone tell me how I can delete an object of type itkImage? I want
> > to keep only a limited number of itkImage objects in memory and
> > therefore I want to delete an object on purpose. I tried to use
> > UnRegister() which successfully decreased the reference count and
> > deleted the object. However, the methods IsNull() and IsNotNull()
> > don't work on the smart pointer correctly after that. Additionally,
> > since the itkImage is a member of an object I get a segmentation fault
> > if the object is destroyed. Any help would be appreciated.
> >
> > Jens
> > _______________________________________________
> > Insight-users mailing list
> > Insight-users at itk.org
> > http://www.itk.org/mailman/listinfo/insight-users
> >
> >
> >
>
>
More information about the Insight-users
mailing list