Skip to content

Commit

Permalink
dispose vm in Quickjs.eval_code
Browse files Browse the repository at this point in the history
  • Loading branch information
hmsk committed Jul 14, 2024
1 parent c8fadfe commit e02ce73
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/quickjs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@

module Quickjs
def eval_code(code, overwrite_opts = {})
Quickjs::VM.new(**overwrite_opts).eval_code(code)
vm = Quickjs::VM.new(**overwrite_opts)
res = vm.eval_code(code)
vm.dispose!
res
end

module_function :eval_code
end

0 comments on commit e02ce73

Please sign in to comment.