From 5277d7b6e5acb490875dc4d307190c88be738336 Mon Sep 17 00:00:00 2001 From: heister Date: Tue, 12 Oct 2010 18:50:40 +0000 Subject: [PATCH] Fix memory leak in FGMRES. git-svn-id: https://svn.dealii.org/trunk@22311 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/solver_gmres.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/deal.II/lac/include/lac/solver_gmres.h b/deal.II/lac/include/lac/solver_gmres.h index 73b3d0ab0a..a1c76a1b7b 100644 --- a/deal.II/lac/include/lac/solver_gmres.h +++ b/deal.II/lac/include/lac/solver_gmres.h @@ -891,9 +891,9 @@ SolverFGMRES::solve ( // Iteration starts here + VECTOR* aux = this->memory.alloc(); do { - VECTOR* aux = this->memory.alloc(); aux->reinit(x); A.vmult(*aux, x); aux->sadd(-1., 1., b); @@ -941,9 +941,10 @@ SolverFGMRES::solve ( for (unsigned int j=0;jmemory.free(aux); } while (iteration_state == SolverControl::iterate); + this->memory.free(aux); + deallog.pop(); // in case of failure: throw // exception -- 2.39.5