Commit e5d7c85d authored by Praetorius, Simon's avatar Praetorius, Simon

destructor of ProblemStat: NULL-check

parent 358a977c
......@@ -102,29 +102,36 @@ namespace AMDiS {
ProblemStatSeq::~ProblemStatSeq()
{
delete rhs;
if (rhs)
delete rhs;
rhs = NULL;
delete solution;
if (solution)
delete solution;
solution = NULL;
for (int i = 0; i < nComponents; i++)
for (int j = 0; j < nComponents; j++)
if ((*systemMatrix)[i][j]) {
delete (*systemMatrix)[i][j];
(*systemMatrix)[i][j] = NULL;
}
delete systemMatrix;
systemMatrix = NULL;
if (systemMatrix) {
for (int i = 0; i < nComponents; i++)
for (int j = 0; j < nComponents; j++)
if ((*systemMatrix)[i][j]) {
delete (*systemMatrix)[i][j];
(*systemMatrix)[i][j] = NULL;
}
delete systemMatrix;
systemMatrix = NULL;
}
for (unsigned int i = 0; i < meshes.size(); i++)
delete meshes[i];
if (meshes[i])
delete meshes[i];
for (unsigned int i = 0; i < estimator.size(); i++)
delete estimator[i];
if (estimator[i])
delete estimator[i];
for (unsigned int i = 0; i < marker.size(); i++)
delete marker[i];
if (marker[i])
delete marker[i];
}
......@@ -1316,7 +1323,7 @@ namespace AMDiS {
if (rhs)
rhs->getDOFVector(row)->getBoundaryManager()->addBoundaryCondition(dirichletApply);
if (solution)
solution->getDOFVector(row)->getBoundaryManager()->addBoundaryCondition(dirichletApply);
solution->getDOFVector(col)->getBoundaryManager()->addBoundaryCondition(dirichletApply);
}
......@@ -1344,7 +1351,7 @@ namespace AMDiS {
if (rhs)
rhs->getDOFVector(row)->getBoundaryManager()->addBoundaryCondition(dirichletApply);
if (solution)
solution->getDOFVector(row)->getBoundaryManager()->addBoundaryCondition(dirichletApply);
solution->getDOFVector(col)->getBoundaryManager()->addBoundaryCondition(dirichletApply);
}
......
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