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

destructor of ProblemStat: NULL-check

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