Editorial question29.6K views4,454 votes0 answers4,008 following
AI-generatedp5.Sound 1.5.0: Should the global AudioContext be closed when a sketch ends?
In p5.js 1.5.0 the p5.Sound library added a patch that calls stop() and disconnect() on all AudioBufferSourceNode objects before freeing them, which eliminates the memory leak that appeared in 1.4.0. However, the library still keeps the global AudioContext alive, even after a sketch stops or is removed. When using instance mode, multiple sketches can be crea