[19102] | 1 | Index: ../trunk-jpl/src/c/classes/FemModel.cpp
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- ../trunk-jpl/src/c/classes/FemModel.cpp (revision 18889)
|
---|
| 4 | +++ ../trunk-jpl/src/c/classes/FemModel.cpp (revision 18890)
|
---|
| 5 | @@ -89,6 +89,7 @@
|
---|
| 6 | FemModel::FemModel(char* rootpath, char* inputfilename, char* outputfilename, char* toolkitsfilename, char* lockfilename, ISSM_MPI_Comm incomm, int solution_type,IssmPDouble* X){ /*{{{*/
|
---|
| 7 |
|
---|
| 8 | bool traceon=true;
|
---|
| 9 | + this->profiler=NULL; /*avoid leak, as we are not using the profiler ever in ad control run. */
|
---|
| 10 |
|
---|
| 11 | /*Store the communicator, but do not set it as a global variable, as this has already
|
---|
| 12 | * been done by the FemModel that called this copy constructor: */
|
---|
| 13 | @@ -111,21 +112,20 @@
|
---|
| 14 | this->parameters->FindParam(&lockfilename,LockFileNameEnum);
|
---|
| 15 |
|
---|
| 16 | /*Delete all the datasets: */
|
---|
| 17 | - xDelete<int>(analysis_type_list);
|
---|
| 18 | - xDelete<char>(outbinfilename);
|
---|
| 19 | - xDelete<char>(lockfilename);
|
---|
| 20 | - delete elements;
|
---|
| 21 | - delete nodes;
|
---|
| 22 | - delete vertices;
|
---|
| 23 | - delete constraints;
|
---|
| 24 | - delete loads;
|
---|
| 25 | - delete materials;
|
---|
| 26 | - delete parameters;
|
---|
| 27 | - delete results;
|
---|
| 28 | + if(analysis_type_list)xDelete<int>(analysis_type_list);
|
---|
| 29 | + if(outbinfilename)xDelete<char>(outbinfilename);
|
---|
| 30 | + if(lockfilename)xDelete<char>(lockfilename);
|
---|
| 31 | + if(elements)delete elements;
|
---|
| 32 | + if(nodes)delete nodes;
|
---|
| 33 | + if(vertices)delete vertices;
|
---|
| 34 | + if(constraints)delete constraints;
|
---|
| 35 | + if(loads)delete loads;
|
---|
| 36 | + if(materials)delete materials;
|
---|
| 37 | + if(parameters)delete parameters;
|
---|
| 38 | + if(results)delete results;
|
---|
| 39 |
|
---|
| 40 | /*Now delete: */
|
---|
| 41 | - delete profiler;
|
---|
| 42 | -
|
---|
| 43 | + if(profiler)delete profiler;
|
---|
| 44 | }
|
---|
| 45 | /*}}}*/
|
---|
| 46 |
|
---|