GoogleChrome/audion

Remove disposed oscillators from debug view

distante opened this issue · 5 comments

Since they are "one time only" nodes the extension should remove the oscillator graphics when they are stopped/disposed like Firefox debugger does.

Chrome:
chrome

Firefox:
firefox

hoch commented

This is because Chrome DevTool does not have a special hook that exposes collected AudioNode. This requires the implementation change in Chrome, meaning that there's nothing can be done within this extension.

Hi @hoch thanks for your response. Would not be safe to asume that if a oscillator has no connections (in/out) and it used stop() it will be disposed shortly?

hoch commented

AudioNode does not expose the number of active connections - meaning that the extension has to track all the connection by injecting a wrapper around the node. Also the destruction (after GC) of AudioNode must correspond to the deletion of the node in the visualization. Otherwise, it will be misleading one way or another. For example, if the code keeps the reference to an AudioNode even after disconnection and stop() call.

With that said, @chihuahua and I can review the PR if you're willing to contribute here. :)

I promess I will try to do it.

This issue applies to any AudioNode that is created. Since AudioBufferSourceNodes are single use, they are continuously thrown away, but they pile up in the display and result in a potentially massive memory leak if this plug-in is enabled.