Skip to content
Snippets Groups Projects
Commit 9e7196de authored by Anton Akhmerov's avatar Anton Akhmerov Committed by Christoph Groth
Browse files

fix bug in f4f8bf6ee which reintroduced the memory leak

parent a8b5bf33
No related branches found
No related tags found
No related merge requests found
......@@ -15,11 +15,8 @@ from kwant import physics, system
# reached all of our users.
def del_for_umfpackcontext(self):
self.free()
try:
if not hasattr(spl.dsolve.umfpack.UmfpackContext, '__del__'):
spl.dsolve.umfpack.UmfpackContext.__del__ = del_for_umfpackcontext
except:
pass
if not hasattr(umfpack.UmfpackContext, '__del__'):
umfpack.UmfpackContext.__del__ = del_for_umfpackcontext
del del_for_umfpackcontext
def factorized(A, piv_tol=1.0, sym_piv_tol=1.0):
......
......@@ -280,4 +280,7 @@ def test_very_singular_leads():
sys.attach_lead(right_lead)
fsys = sys.finalized()
result = solve(fsys)
assert result[1] == [0, 2]
\ No newline at end of file
assert result[1] == [0, 2]
def test_umfpack_del():
assert hasattr(kwant.solvers.sparse.umfpack.UmfpackContext, '__del__')
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