Skip to content

Killing a destroyed node should not throw an error #215

Open
neatonk opened this Issue Jan 22, 2013 · 2 comments

2 participants

@neatonk
Overtone member
neatonk commented Jan 22, 2013
(use 'overtone.live)

(defsynth foo []
  (let [env (line 1 0 0.5 FREE)]
    (out 0 (pan2 (* env (sin-osc))))))

(let [node (foo)] ; create a node
  (Thread/sleep 1000) ; let it die
  (kill node)) ; try to kill it
;; BOOM
@samaaron
Overtone member

This can be argued to be correct behaviour. The user is attempting to perform an operation on a synth node which no longer responds and it can be argued that the user should be informed of this.

Perhaps an exception is too heavy a notification. However, I think we should keep this for 0.8.0 to maintain consistency with the other node modification exceptions and review and discuss for future versions after people have had chance to play with it.

@neatonk
Overtone member
neatonk commented Jan 22, 2013

This can be argued to be correct behaviour. The user is attempting to perform an operation on a synth node which no longer responds and it can be argued that the user should be informed of this.

I understand this argument, but throwing an exception will do more than inform the user. It will stop their code from running. This doesn't work well when synth's can free themselves.

However, I think we should keep this for 0.8.0 to maintain consistency with the other node modification exceptions and review and discuss for future versions after people have had chance to play with it.

Sounds good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.