[vtkusers] What exactly happens in this scenario?

Bill Lorensen bill.lorensen at gmail.com
Sat Jun 26 15:36:36 EDT 2010


You should be fine.

On Sat, Jun 26, 2010 at 3:12 PM, Rakesh Patil <rakeshthp at in.com> wrote:
>
> Oh...
>
> Then wat will happen if i remove from renderer and then delete..?? will it
> lead to crashing of app..??
>
> Thanks
> ---------- Original message ----------
> From:"Bill Lorensen"< bill.lorensen at gmail.com >
> Date: 27 Jun 10 00:14:42
> Subject: Re: Re: [vtkusers] What exactly happens in this scenario?
> To: Rakesh Patil <rakeshthp at in.com>
>
> You need not remove it from the renderer. The renderer as part of its
> destructor will UnRegister() it's actors. Once the ref count of the
> actor goes to 0, it will be deleted.
>
> On Sat, Jun 26, 2010 at 12:29 PM, Rakesh Patil <rakeshthp at in.com> wrote:
>> hi,
>>
>> thanks.. then wat about the actor?? should it be removed from the renderer
>> and then, deleted or
>> if i delete, it is directly removed from the renderer??
>>
>> Thanks
>>
>> ---------- Original message ----------
>> From:"Bill Lorensen"< bill.lorensen at gmail.com >
>> Date: 25 Jun 10 18:23:59
>> Subject: Re: [vtkusers] What exactly happens in this scenario?
>> To: logic_cube & lt;John.Fraser at icr.ac.uk>
>>
>> In the destructor? Technically, yes. But it won't matter.
>>
>> On Fri, Jun 25, 2010 at 8:51 AM, logic_cube <John.Fraser at icr.ac.uk> wrote:
>>>
>>> Shouldn't it be like this?
>>>
>>> if (elementNumberActor != NULL)
>>> {
>>> elementNumberActor->Delete();
>>> elementNumberActor = NULL;
>>> }
>>>
>>>
>>>
>>> Bill Lorensen-2 wrote:
>>>>
>>>> Yes, it will leak.
>>>>
>>>> To prevent the leak,, in your constructor,
>>>> elementNumberActor = NULL;
>>>& gt;
>>>> In DisplayElementNumbers() before assigning the actor,
>>>> if (elementNumberActor != NULL)
>>>> {
>>>> elementNumberActor->Delete();
>>>> }
>>>>
>>>> In the destuctor,
>>>> if (elementNumberActor != NULL)
>> >> {
>>>> elementNumberActor->Delete();
>>>> }
>>>>
>>>>
>>>
>>> --
>>> View this message in context: <a
>>>
>>> href="http://old.nabble.com/What-exactly-happens-in-this-scenario--tp28991361p28991987.html"
>>>
>>> target="_blank">http://old.nabble.com/What-exactly-happens-in-this-scenario--tp28991361p28991987.html</a>
>>> Sent from the VTK - Users mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> Powered by <a href="http://www.kitware.com"
>>> target="_blank">www.kitware.com</a>
>>>
>>> Visit other Kitware open-source projects at <a
>>> href="http://www.kitware.com/opensource/opensou rce.html"
>>> target="_blank">http://www.kitware.com/opensource/opensource.html</a>
>>>
>>> Please keep messages on-topic and check the VTK FAQ at: <a
>>> href="http://www.vtk.org/Wiki/VTK_FAQ"
>>> target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a>
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> <a href="http://www.vtk.org/mailman/listinfo/vtkusers"
>>> target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a>
>>>
>> _______________________________________________
>> Powered by <a href="http://www.kitware.com"
>> target="_blank">www.kitware.com</a>
>>
>> Visit other Kitware open-source projects at <a
>> href="http://www.kitware.com/opensource/opensource.html"
>> target="_blank">http://www.kitware.com/opensource/opensource.html</a>
>>
>> Please keep messages on-topic and check the VTK FAQ at: <a
>> href="http://www.vtk.org/Wiki/VTK_FAQ"
>> target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a>
>>
>> Follow this link to subscri be/unsubscribe:
>> <a href="http://www.vtk.org/mailman/listinfo/vtkusers"
>> target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a>
>>
>>
>> Get Yourself a cool, short @in.com Email ID now!
>
>
> Get Yourself a cool, short @in.com Email ID now!



More information about the vtkusers mailing list