]> SALOME platform Git repositories - tools/solverlab.git/commitdiff
Salome HOME
Corrected important memory leak
authormichael <michael@localhost.localdomain>
Wed, 18 Nov 2020 12:24:21 +0000 (13:24 +0100)
committermichael <michael@localhost.localdomain>
Wed, 18 Nov 2020 12:24:21 +0000 (13:24 +0100)
CDMATH/linearsolver/src/SparseMatrixPetsc.cxx [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 31a943c..651a744
@@ -340,8 +340,16 @@ SparseMatrixPetsc::operator* (const Vector& vec) const
        MatAssemblyBegin(_mat, MAT_FINAL_ASSEMBLY);
        MatAssemblyEnd(_mat, MAT_FINAL_ASSEMBLY);
        MatMult(_mat,X,Y);
+       //Clean memory
+       VecDestroy(&X);
 
-       return vecToVector(Y);
+    Vector result=vecToVector(Y);
+
+       //Clean memory
+       VecDestroy(&Y);
+
+       return result;
 }
 
 SparseMatrixPetsc&