bind, close

Mon, 23 Dec 2019 21:31:48 +0200

author
Tuomo Valkonen <tuomov@iki.fi>
date
Mon, 23 Dec 2019 21:31:48 +0200
changeset 27
51bb83c404a4
parent 26
863711a498fe
child 28
d1f40f6654cb

bind, close

src/Visualise.jl file | annotate | diff | comparison | revisions
--- a/src/Visualise.jl	Mon Dec 23 21:30:38 2019 +0200
+++ b/src/Visualise.jl	Mon Dec 23 21:31:48 2019 +0200
@@ -191,7 +191,8 @@
     if visualise
         rc = Channel(1)
         visproc = Threads.@spawn bg_visualise(rc)
-        vis =rc
+        bind(rc, visproc)
+        vis = rc
     else
         vis = false
         visproc = nothing
@@ -207,6 +208,7 @@
     if isa(st.vis, Channel)
         # Tell subprocess to finish, and wait
         put!(st.vis, nothing)
+        close(st.vis)
         wait(st.visproc)
     end
 end

mercurial