From 14e8e4f8489bb333c60055f1c1bfbca03b19cfcc Mon Sep 17 00:00:00 2001 From: Thomas Witkowski Date: Tue, 15 May 2012 13:14:47 +0000 Subject: [PATCH] Small bugfix. --- AMDiS/src/parallel/PetscSolverGlobalMatrix.cc | 5 ++++- AMDiS/src/parallel/PetscSolverGlobalMatrix.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/AMDiS/src/parallel/PetscSolverGlobalMatrix.cc b/AMDiS/src/parallel/PetscSolverGlobalMatrix.cc index b7817352..aa99d09e 100644 --- a/AMDiS/src/parallel/PetscSolverGlobalMatrix.cc +++ b/AMDiS/src/parallel/PetscSolverGlobalMatrix.cc @@ -492,7 +492,10 @@ namespace AMDiS { MatDestroy(&matIntInt); KSPDestroy(&kspInterior); - VecDestroy(&petscSolVec); + + if (petscSolVec != PETSC_NULL) + VecDestroy(&petscSolVec); + petscSolVec = PETSC_NULL; } diff --git a/AMDiS/src/parallel/PetscSolverGlobalMatrix.h b/AMDiS/src/parallel/PetscSolverGlobalMatrix.h index c04abe1e..caf3c976 100644 --- a/AMDiS/src/parallel/PetscSolverGlobalMatrix.h +++ b/AMDiS/src/parallel/PetscSolverGlobalMatrix.h @@ -36,6 +36,7 @@ namespace AMDiS { public: PetscSolverGlobalMatrix() : PetscSolver(), + petscSolVec(PETSC_NULL), d_nnz(NULL), o_nnz(NULL), lastMeshNnz(0), -- GitLab