Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions boot/pod/src/boot/pod.clj
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,11 @@
boot. See #'boot.pod/add-shutdown-hook! for more info."
(atom nil))

(def ^:dynamic *destroy-pod-hook*
"Bind this to a 0-arity function in order to perform additional
cleanup."
identity)

(defn set-pods! [x] (alter-var-root #'pods (constantly x)))
(defn set-data! [x] (alter-var-root #'data (constantly x)))
(defn set-pod-id! [x] (alter-var-root #'pod-id (constantly x)))
Expand Down Expand Up @@ -823,6 +828,7 @@
"Closes open resources held by the pod, making the pod eligible for GC."
[pod]
(when pod
(*destroy-pod-hook*)
(.close pod)
(.. pod getClassLoader close)))

Expand Down