<div>Hi, </div><div><br></div><div>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:</div>
<div><br></div><div><span class="Apple-style-span" style="border-collapse: collapse; "><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-indent: 0px; ">this->GetOutputPortInformation(0)->Set(</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-indent: 0px; ">vtkDataObject::DATA_EXTENT_TYPE(), <b>newOutput->GetExtentType()</b>);</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-indent: 0px; ">
</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-indent: 0px; "><b>newOutput->Delete();</b></p><div><b><br></b></div><p></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-indent: 0px; ">
instead of:</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-indent: 0px; "><br></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-indent: 0px; ">
</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-indent: 0px; "><b>newOutput->Delete();</b></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-indent: 0px; ">
this->GetOutputPortInformation(0)->Set(</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-indent: 0px; ">vtkDataObject::DATA_EXTENT_TYPE(), <b>newOutput->GetExtentType()</b>);</p>
<p></p></span></div><div><br></div><div>Am I missing something here?</div><div><br></div>Thanks,<div>Paul</div><div><br></div><div><div class="gmail_quote">2009/8/25 Jeff Baumes <span dir="ltr"><<a href="mailto:jeff.baumes@kitware.com">jeff.baumes@kitware.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im"><br><div class="gmail_quote">On Tue, Aug 25, 2009 at 8:43 AM, Paul Edwards <span dir="ltr"><<a href="mailto:paul.m.edwards@gmail.com" target="_blank">paul.m.edwards@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>Is there a reason why Delete is called before GetExtentType? Or is this a bug? (although it doesn't crash on me....)<br></div></blockquote></div><br></div><span style="border-collapse:collapse">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.</span><div>
<span style="border-collapse:collapse"><br></span></div><font color="#888888"><div><span style="border-collapse:collapse">Jeff<br clear="all"></span><br>
</div>
</font></blockquote></div><br></div>