v.destroy()
Use v.destroy() when you are done with nodes and want to release Volten-owned internal resources.
const node = v.pass(kernel, { data });v.run(node);
v.destroy(node);If the node depends on earlier work through handles, those dependencies are included too.
What It Destroys
Section titled “What It Destroys”v.destroy() destroys resources created by Volten for nodes, such as hidden bounds-guard uniforms and debug buffers.
It does not destroy user-created resources:
BufferRawBufferUniform
v.destroy(node);
// User buffers are still yours.data.set([1, 2, 3, 4]);Multiple Nodes
Section titled “Multiple Nodes”v.destroy([A, B]);Shared dependencies are visited once.
Reuse After Destroy
Section titled “Reuse After Destroy”Calling v.destroy(node) is safe more than once.
You can also run the node again later. Volten recreates the internal resources it needs.
v.destroy(node);v.run(node);