<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Hi Dan,<BR>
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 ;)<BR>
Cheers<BR>
Samuele <BR> <BR>> Date: Wed, 30 Dec 2009 13:46:42 +0100<BR>> Subject: Re: [Insight-users] force to destroy object<BR>> From: dan.muel@gmail.com<BR>> To: samuele_82@hotmail.com<BR>> CC: insight-users@itk.org<BR>> <BR>> Hi Smauele,<BR>> <BR>> One of great things about ITK is the SmartPointer: as soon as an<BR>> object with no references goes out-of-scope, the smart pointer<BR>> automagically releases the object.<BR>> <BR>> My advice would be to let the SmartPointer release the object for you;<BR>> this will force you to think of a good design in which you maximize<BR>> the use of scope to release your objects :P<BR>> <BR>> If this is not possible and/or you prefer the manual approach, after a<BR>> cup of coffee and long think try:<BR>> object->SetReferenceCount( 0 );<BR>> <BR>> Please take note of the documentation attached to the SetReferenceCount method:<BR>> Sets the reference count (use with care) // << TAKE NOTE!!<BR>> <BR>> HTH<BR>> <BR>> Cheers, Dan<BR>> <BR>> 2009/12/30 Samuele Dietler <samuele_82@hotmail.com>:<BR>> > Hi ITK users,<BR>> > there is a way to force to destroy an object or we should wait for<BR>> > autodiscruction by set the object to NULL value???<BR>> > Thank you, best<BR>> > Samuele<BR>> ><BR>> > ________________________________<BR>> > Windows Live: tieni aggiornati i tuoi amici sulle tue attivitą in linea.<BR>> > _____________________________________<BR>> > Powered by www.kitware.com<BR>> ><BR>> > Visit other Kitware open-source projects at<BR>> > http://www.kitware.com/opensource/opensource.html<BR>> ><BR>> > Kitware offers ITK Training Courses, for more information visit:<BR>> > http://www.kitware.com/products/protraining.html<BR>> ><BR>> > Please keep messages on-topic and check the ITK FAQ at:<BR>> > http://www.itk.org/Wiki/ITK_FAQ<BR>> ><BR>> > Follow this link to subscribe/unsubscribe:<BR>> > http://www.itk.org/mailman/listinfo/insight-users<BR>> ><BR>> ><BR>                                            <br /><hr />Windows Live: rendi pił semplice per i tuoi amici vedere <a href='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_2:092010' target='_new'>cosa stai facendo su Facebook.</a></body>
</html>