From 87f5e325e5bb18f54e1af585207c5fca64ebf857 Mon Sep 17 00:00:00 2001 From: NikoOinonen Date: Tue, 10 Dec 2024 16:24:22 +0200 Subject: [PATCH] Fix wrong array. --- ppafm/HighLevel.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ppafm/HighLevel.py b/ppafm/HighLevel.py index 4ea2e24..508bee2 100755 --- a/ppafm/HighLevel.py +++ b/ppafm/HighLevel.py @@ -211,11 +211,11 @@ def prepareArrays(FF, Vpot, parameters): gridN = np.shape(FF) parameters.gridN = gridN core.setFF_Fpointer(FF) - weakref.finalize(FF, lambda: core.deleteFF_Fpointer()) # Set array pointer to NULL when garbage collector runs. + weakref.finalize(FF, core.deleteFF_Fpointer) # Set array pointer to NULL when garbage collector runs. if Vpot: V = np.zeros((gridN[2], gridN[1], gridN[0])) core.setFF_Epointer(V) - weakref.finalize(FF, lambda: core.deleteFF_Epointer()) + weakref.finalize(V, core.deleteFF_Epointer) else: V = None return FF, V