[Paraview] vtkDataObjectAlgorithm with multiple inputs
Paul Edwards
paul.m.edwards at gmail.com
Tue Aug 25 13:33:18 EDT 2009
Hi,
I understand there is a need to call Delete on the object but I don't
understand why it is called before the line that uses the object that has
just been deleted. I.e. why isn't it:
this->GetOutputPortInformation(0)->Set(
vtkDataObject::DATA_EXTENT_TYPE(), *newOutput->GetExtentType()*);
*newOutput->Delete();*
*
*
instead of:
*newOutput->Delete();*
this->GetOutputPortInformation(0)->Set(
vtkDataObject::DATA_EXTENT_TYPE(), *newOutput->GetExtentType()*);
Am I missing something here?
Thanks,Paul
2009/8/25 Jeff Baumes <jeff.baumes at kitware.com>
>
> On Tue, Aug 25, 2009 at 8:43 AM, Paul Edwards <paul.m.edwards at gmail.com>wrote:
>
>> Is there a reason why Delete is called before GetExtentType? Or is this a
>> bug? (although it doesn't crash on me....)
>>
>
> SetPipelineInformation will cause the information object to increment the
> reference count of the data object. Thus calling Delete will safely
> decrement the reference count without yet releasing the memory (this matches
> the reference created by NewInstance()). This is necessary or else a
> reference will be floating and the object will never be deleted.
> Jeff
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20090825/62528bc1/attachment.htm>
More information about the ParaView
mailing list