Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
iwr
amdis
Commits
e5d7c85d
Commit
e5d7c85d
authored
Sep 07, 2012
by
Praetorius, Simon
Browse files
destructor of ProblemStat: NULL-check
parent
358a977c
Changes
1
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/ProblemStat.cc
View file @
e5d7c85d
...
...
@@ -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
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment