File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -446,6 +446,7 @@ class Oscillator {
446446 this . stop ( now ) ;
447447 this . disconnect ( ) ;
448448 this . panner . dispose ( ) ;
449+ this . panner = null ;
449450 this . oscillator = null ;
450451 }
451452 // if it is a Pulse
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ if (typeof ac.createStereoPanner !== 'undefined') {
4343 let time = tFromNow || 0 ;
4444 this . stereoPanner . pan . linearRampToValueAtTime (
4545 val ,
46- this . ac . currentTime + 0.02 + time
46+ this . ac . currentTime + time
4747 ) ;
4848 } else if ( typeof val !== 'undefined' ) {
4949 val . connect ( this . stereoPanner . pan ) ;
@@ -157,6 +157,29 @@ if (typeof ac.createStereoPanner !== 'undefined') {
157157 this . output . disconnect ( ) ;
158158 }
159159 }
160+
161+ dispose ( ) {
162+ if ( this . input ) {
163+ this . input . disconnect ( ) ;
164+ delete this . input ;
165+ }
166+ if ( this . output ) {
167+ this . output . disconnect ( ) ;
168+ delete this . output ;
169+ }
170+ if ( this . left ) {
171+ this . left . disconnect ( ) ;
172+ delete this . left ;
173+ }
174+ if ( this . right ) {
175+ this . right . disconnect ( ) ;
176+ delete this . right ;
177+ }
178+ if ( this . splitter ) {
179+ this . splitter . disconnect ( ) ;
180+ delete this . splitter ;
181+ }
182+ }
160183 }
161184 panner = Panner ;
162185}
You can’t perform that action at this time.
0 commit comments