Skip to content

Commit

Permalink
Merge branch 'master' into memoize
Browse files Browse the repository at this point in the history
  • Loading branch information
darkleaf committed Oct 15, 2024
2 parents 153c646 + 9b36a26 commit beb3ea0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/darkleaf/di/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -773,10 +773,11 @@
(if (zero? (count bindings))
`(do ~@body)
(let [[binding-form init-expr] (subvec bindings 0 2)]
`(let [resource# ~init-expr
~binding-form resource#]
`(let [resource# ~init-expr]
(try
(with-open ~(subvec bindings 2) ~@body)
(let [~binding-form resource#]
(with-open ~(subvec bindings 2)
~@body))
(finally
(.close resource#)))))))

Expand Down

0 comments on commit beb3ea0

Please sign in to comment.