From a3a733d52d8cdfa94ad0a3f74c5c71c18d88be11 Mon Sep 17 00:00:00 2001 From: Joroks Date: Thu, 27 Jun 2024 19:21:21 +0200 Subject: [PATCH] fix-LMP --- src/LAMMPS.jl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/LAMMPS.jl b/src/LAMMPS.jl index d9d3661..7f73af4 100644 --- a/src/LAMMPS.jl +++ b/src/LAMMPS.jl @@ -97,13 +97,11 @@ end LMP(f::Function, args=String[], comm=nothing) Create a new LAMMPS instance and call `f` on that instance while returning the result from `f`. -This constructor closes the LAMMPS instance immediately after `f` has executed. """ function LMP(f::Function, args=String[], comm=nothing) lmp = LMP(args, comm) - result = f(lmp) - close!(lmp) - return result + return f(lmp) + # `close!` is registered as a finalizer for LMP, no need to close it here. end function version(lmp::LMP)