Commit 4d9c9c7e authored by camp's avatar camp
Browse files

Fixed memory leaks and mismatching new and delete.



git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@16009 18c085ea-50e0-402c-830e-de6fd14e8384
parent 10368c47
......@@ -86,7 +86,7 @@ avtIVPNIMRODField::avtIVPNIMRODField( vtkDataSet* dataset,
}
// Dummy variable to the template class
float fltVar = 0;
// float fltVar = 0;
// The mesh elements.
// grid_fourier_series =
......@@ -163,7 +163,6 @@ type* avtIVPNIMRODField::SetDataPointer( vtkDataSet *ds,
const int ncomponents )
{
vtkDataArray *array;
int XX;
// Because the triangluar mesh is defined by using non unique points
// and the data is cell centered data VisIt moves it out to the
......@@ -360,11 +359,11 @@ avtIVPNIMRODField::operator()( const double &t, const avtVector &p ) const
double x[3];
ds->GetPoint( ptIds->GetId(ic), x);
double rad, theta, phi;
// double rad, theta, phi;
vec3 P;
mat3 DRV;
// vec3 P;
// mat3 DRV;
// interpolate( rad, theta, phi, &P, &DRV );
......@@ -544,10 +543,10 @@ void avtIVPNIMRODField::interpolate( double rad, double theta, double phi,
*P = p;
// *DRV = Dp;
delete wtheta;
delete dtheta;
delete wrad;
delete drad;
delete wphi;
delete dphi;
delete [] wtheta;
delete [] dtheta;
delete [] wrad;
delete [] drad;
delete [] wphi;
delete [] dphi;
}
......@@ -1336,6 +1336,7 @@ DiscreteMIR::GetDataset(std::vector<int> mats, vtkDataSet *ds,
visitTimer->StopTimer(timerHandle,
"MIR: Getting *completely* clean dataset");
visitTimer->DumpTimings();
delete [] matFlag;
return outmesh;
}
else
......@@ -1343,6 +1344,7 @@ DiscreteMIR::GetDataset(std::vector<int> mats, vtkDataSet *ds,
visitTimer->StopTimer(timerHandle,
"MIR: Getting *empty* clean dataset");
visitTimer->DumpTimings();
delete [] matFlag;
return NULL;
}
}
......
......@@ -182,6 +182,11 @@ REAL findTriangleSetCuttingPlane(
REAL x = newtonSearchPolynomialFunc( surfaceFunction, derivatives[s], y, xmin, xmax );
DBG_MESG( "final x = "<< x );
FREE_LOCAL_ARRAY( derivatives, REAL2, nv-1 );
FREE_LOCAL_ARRAY( index, unsigned char, nv );
FREE_LOCAL_ARRAY( rindex, unsigned char, nv );
return x ;
}
......
......@@ -212,6 +212,11 @@ REAL findTetraSetCuttingPlane(
REAL x = newtonSearchPolynomialFunc( volumeFunction, derivatives[s], y, xmin, xmax );
DBG_MESG( "final x = "<< x );
FREE_LOCAL_ARRAY( rindex, unsigned char, nv );
FREE_LOCAL_ARRAY( index, unsigned char, nv );
FREE_LOCAL_ARRAY( derivatives, REAL3, nv-1 );
return x ;
}
......
......@@ -436,6 +436,7 @@ ZooMIR::GetDataset(std::vector<int> mats, vtkDataSet *ds,
visitTimer->StopTimer(timerHandle,
"MIR: Getting *completely* clean dataset");
visitTimer->DumpTimings();
delete [] matFlag;
return outmesh;
}
else
......@@ -443,6 +444,7 @@ ZooMIR::GetDataset(std::vector<int> mats, vtkDataSet *ds,
visitTimer->StopTimer(timerHandle,
"MIR: Getting *empty* clean dataset");
visitTimer->DumpTimings();
delete [] matFlag;
return NULL;
}
}
......
......@@ -113,6 +113,7 @@ string ASTMultNode::infixString(int lang, NameScope* nameScope)
}
buffer << ")";
string s = buffer.str();
delete [] boolChildFlags;
return s;
}
......
......@@ -994,6 +994,8 @@ ParseException& ExpressionParser::generateParseException(void)
}
}
delete [] la1tokens;
jj_endpos = 0;
jj_rescan_token();
jj_add_error_token(0, 0);
......
......@@ -1430,12 +1430,13 @@ void avtVCellMTMDFileFormat::readVariableValues(const char * simFileName,string
}
}
}
delete [] regionValues;
}else{
dataHolder->SetNumberOfTuples(varDataBlock->size);
double *values = (double *)dataHolder->GetVoidPointer(0);
readDoubles(fp, values, varDataBlock->size);
}
}
}
fclose(fp);
}
......
......@@ -322,6 +322,7 @@ void ElementFetcher::GetElemsFromBinaryFile(std::string filename, long fileOffse
long byteOffset = mFileSet->mBytesPerElem * fileOffset;
if (fseek(fp, byteOffset, SEEK_SET) == -1) {
string msg = string("Error, cannot seek ")+intToString(byteOffset)+" bytes into file: "+filename+string(" (")+strerror(errno)+string(")");
fclose(fp);
EXCEPTION1(VisItException, msg.c_str());
}
......@@ -335,6 +336,7 @@ void ElementFetcher::GetElemsFromBinaryFile(std::string filename, long fileOffse
long chunkElems = chunkBytes/mFileSet->mBytesPerElem;
if (fread((void*)buffer, mFileSet->mBytesPerElem, chunkElems, fp) == -1) {
string msg = string("Error, cannot read ")+intToString(chunkBytes)+" bytes from file: "+filename+string(" (")+strerror(errno)+string(")");
fclose(fp);
EXCEPTION1(VisItException, msg.c_str());
}
char *bufp = buffer;
......@@ -346,6 +348,7 @@ void ElementFetcher::GetElemsFromBinaryFile(std::string filename, long fileOffse
bytesToRead -= chunkBytes;
}
debug2 << "ElementFetcher::GetElemsFromBinaryFile complete " << endl;
fclose(fp);
return;
}
/*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment