Skip to content

Commit

Permalink
fix-LMP (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joroks authored Jun 27, 2024
1 parent 41de7d1 commit cdad665
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/LAMMPS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cdad665

Please sign in to comment.