Skip to content
Snippets Groups Projects

Fix CHOLMOD leak

Merged Oliver Sander requested to merge fix-cholmod-leak-in-2.10 into releases/2.10
1 file
+ 4
0
Compare changes
  • Side-by-side
  • Inline
  • 1368ef43
    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.
    
    (cherry picked from commit e4ffbb1f)
+ 4
0
@@ -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_);
Loading