Tweak
This commit is contained in:
parent
02cef05574
commit
a0418d6622
1 changed files with 5 additions and 3 deletions
|
|
@ -244,7 +244,7 @@
|
||||||
(Socket. hostname port))
|
(Socket. hostname port))
|
||||||
|
|
||||||
(defn close-socket
|
(defn close-socket
|
||||||
"Close the socket, and also closes its input and output streams. Returns nil."
|
"Close the socket, and also closes its input and output streams."
|
||||||
[^Socket socket]
|
[^Socket socket]
|
||||||
(try (.close socket)
|
(try (.close socket)
|
||||||
nil
|
nil
|
||||||
|
|
@ -318,9 +318,11 @@
|
||||||
(get-string ns "name"))
|
(get-string ns "name"))
|
||||||
(next-id))
|
(next-id))
|
||||||
_ (add-shutdown-hook! #(do
|
_ (add-shutdown-hook! #(do
|
||||||
|
(destroy pod-id)
|
||||||
(when socket
|
(when socket
|
||||||
(close-socket socket))
|
;; this probably isn't necessary because we
|
||||||
(destroy pod-id)))
|
;; killed the process, but anyway
|
||||||
|
(close-socket socket))))
|
||||||
pod (assoc pod :pod-id pod-id)
|
pod (assoc pod :pod-id pod-id)
|
||||||
pod-namespaces (mapv #(bencode->namespace pod %)
|
pod-namespaces (mapv #(bencode->namespace pod %)
|
||||||
pod-namespaces)
|
pod-namespaces)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue