<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Hi!<br>I´ve written a Wrapper for the Legacy VTK files writer, so that it writes a whole timeseries if I want it to. Lamentably, applying it, it needs more and more memory, so I am looking for a memory leak. <br><br>Here is the bit of code I suspect:<br><br> vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);<br> vtkDataObject* input = inInfo->Get(vtkDataObject::DATA_OBJECT());<br><br> vtkSmartPointer<vtkDataObject> inputCopy;<br> inputCopy.TakeReference(input->NewInstance());<br> inputCopy->ShallowCopy(input);<br><br> vtksys_ios::ostringstream fname;<br> if (this->WriteAllTimeSteps)<br> {<br> vtkstd::string path =<br> vtksys::SystemTools::GetFilenamePath(this->FileName);<br> vtkstd::string fnamenoext =<br> vtksys::SystemTools::GetFilenameWithoutLastExtension(this->FileName);<br> vtkstd::string ext =<br> vtksys::SystemTools::GetFilenameLastExtension(this->FileName);<br> if((this -> CurrentTimeIndex) < 10) fname << path << "/" << fnamenoext << ".000" <<this->CurrentTimeIndex << ext;<br> else if((this -> CurrentTimeIndex) < 100) fname << path << "/" << fnamenoext << ".00" << this -> CurrentTimeIndex << ext;<br> else if((this -> CurrentTimeIndex) < 1000) fname << path << "/" << fnamenoext << ".0" << this -> CurrentTimeIndex << ext;<br> else fname << path << "/" << fnamenoext << this -> CurrentTimeIndex << ext;<br> }<br> else<br> {<br> fname << this->FileName;<br> }<br><br>//Here I call the usual VTK Writer and set the input<br><br> vtkGenericDataObjectWriter* Writer = vtkGenericDataObjectWriter::New();<br> Writer -> SetInput(inputCopy);<br> Writer -> SetFileName(fname.str().c_str());<br> if((this -> FileType) == 1) Writer -> SetFileTypeToASCII();<br> else Writer -> SetFileTypeToBinary();<br><br> Writer -> Update();<br><br> if (this->WriteAllTimeSteps)<br> {<br> this->CurrentTimeIndex++;<br> if (this->CurrentTimeIndex == this->NumberOfTimeSteps)<br> {<br> // Tell the pipeline to stop looping.<br> request->Remove(vtkStreamingDemandDrivenPipeline::CONTINUE_EXECUTING());<br> this->CurrentTimeIndex = 0;<br> }<br> }<br><br> Writer -> Delete();<br> return 1;<br><br>Is there anything I forget to delete?<br><br><br>thx for answers<br>Natalie<br><br><br><br /><hr />Nuevo Internet Explorer 8 <a href='http://www.ie8.msn.com/microsoft/internet-explorer-8/es-xl/ie8.aspx' target='_new'>ĦEs Gratis y optimizado para MSN!</a></body>
</html>