[Insight-users] force to destroy object

Samuele Dietler samuele_82 at hotmail.com
Wed Dec 30 07:59:51 EST 2009


Hi Dan,

thank's for your answer....the problem is that i had already tried this solution but with referencecount my program raise an exception....it was for this reason that i was asking this question ;) Anyway, i will "wait" for the automagically distruction ofthe object ;)

Cheers

Samuele  
 
> Date: Wed, 30 Dec 2009 13:46:42 +0100
> Subject: Re: [Insight-users] force to destroy object
> From: dan.muel at gmail.com
> To: samuele_82 at hotmail.com
> CC: insight-users at itk.org
> 
> Hi Smauele,
> 
> One of great things about ITK is the SmartPointer: as soon as an
> object with no references goes out-of-scope, the smart pointer
> automagically releases the object.
> 
> My advice would be to let the SmartPointer release the object for you;
> this will force you to think of a good design in which you maximize
> the use of scope to release your objects :P
> 
> If this is not possible and/or you prefer the manual approach, after a
> cup of coffee and long think try:
> object->SetReferenceCount( 0 );
> 
> Please take note of the documentation attached to the SetReferenceCount method:
> Sets the reference count (use with care) // << TAKE NOTE!!
> 
> HTH
> 
> Cheers, Dan
> 
> 2009/12/30 Samuele Dietler <samuele_82 at hotmail.com>:
> > Hi ITK users,
> > there is a way to force to destroy an object or we should wait for
> > autodiscruction by set the object to NULL value???
> > Thank you, best
> > Samuele
> >
> > ________________________________
> > Windows Live: tieni aggiornati i tuoi amici sulle tue attività in linea.
> > _____________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Kitware offers ITK Training Courses, for more information visit:
> > http://www.kitware.com/products/protraining.html
> >
> > Please keep messages on-topic and check the ITK FAQ at:
> > http://www.itk.org/Wiki/ITK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.itk.org/mailman/listinfo/insight-users
> >
> >
 		 	   		  
_________________________________________________________________
Windows Live: tieni aggiornati i tuoi amici sulle tue attività in linea.
http://www.microsoft.com/italy/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:it-it:SI_SB_1:092009
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20091230/4785d510/attachment.htm>


More information about the Insight-users mailing list