You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a ChucK VM is started (with either chuck --loop or chuck --shell), I've noticed that memory isn't being freed when you explicitly remove a shred (as opposed to letting the shred remove itself).
This bug can be seen by placing printf statements in the constructor/destructor functions of a particular ugen (for instance, SinOsc). A testing chuck file could look like this:
SinOsc s => dac; 10::second => now;
Running "+ sine.ck" and letting it remove it self will cause both the ctor and dtor messages to appear. Running "- 1" before the 10 seconds are up will not call the dtor message.
The text was updated successfully, but these errors were encountered:
Hmm, yes this is actually a pretty complicated issue. "- 1" basically stops the running code right where it is, without releasing references to any objects in scope (object destructors are called when all references to the object have been released). To fix this ChucK would need a way to disentangle itself from multiple nested scopes, e.g. for the code
ChucK would need to know which objects are appropriate to ref-release at any point in this code. Given ChucK's VM model, I don't think this is something it knows at run-time, when the -1 would be issued; rather it is all handled at compile-time. We need to add some sort of "escape hatch" that properly releases active references at any scope, or else track which references belong to which scope at run-time.
Hello,
When a ChucK VM is started (with either chuck --loop or chuck --shell), I've noticed that memory isn't being freed when you explicitly remove a shred (as opposed to letting the shred remove itself).
This bug can be seen by placing printf statements in the constructor/destructor functions of a particular ugen (for instance, SinOsc). A testing chuck file could look like this:
SinOsc s => dac; 10::second => now;
Running "+ sine.ck" and letting it remove it self will cause both the ctor and dtor messages to appear. Running "- 1" before the 10 seconds are up will not call the dtor message.
The text was updated successfully, but these errors were encountered: