Skip to content
Snippets Groups Projects
Commit e4ffbb1f authored by Oliver Sander's avatar Oliver Sander
Browse files

Fix memory leak in the CHOLMOD wrapper code

When calling CHOLMOD to compute the Cholesky factor of a matrix,
it was not tested whether such a factor already existed. As a
consequence, if the solver was called twice in a row, the old
factor would be lost to a memory leak.

Fix this by explicitly deallocating the old Cholesky factor
before asking CHOLMOD for a new one.
parent e4079597
No related branches found
No related tags found
1 merge request!602Fix memory leak in the CHOLMOD wrapper code
Pipeline #76464 passed
......@@ -461,6 +461,10 @@ public:
});
// Remove old factor that may be left over from a previous run
if (L_)
CholmodMethod::free_factor(&L_, &c_);
// Now analyse the pattern and optimal row order
L_ = CholmodMethod::analyze(M.get(), &c_);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment