mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-23 06:45:32 +00:00
emscriptenaudio: Don't bother undefining things about to be unreachable.
Since the top-level table is getting undefined, all the things in it will be unreachable and eligible for garbage collection without explicitly nulling them out. (cherry picked from commit 5191b20541fce0e3b3071124ced69c31fcaeb783)
This commit is contained in:
parent
ae7f54f514
commit
ddbbef88e3
|
@ -163,32 +163,22 @@ static void EMSCRIPTENAUDIO_CloseDevice(_THIS)
|
||||||
for (var i = 0; i < tracks.length; i++) {
|
for (var i = 0; i < tracks.length; i++) {
|
||||||
SDL2.capture.stream.removeTrack(tracks[i]);
|
SDL2.capture.stream.removeTrack(tracks[i]);
|
||||||
}
|
}
|
||||||
SDL2.capture.stream = undefined;
|
|
||||||
}
|
}
|
||||||
if (SDL2.capture.scriptProcessorNode !== undefined) {
|
if (SDL2.capture.scriptProcessorNode !== undefined) {
|
||||||
SDL2.capture.scriptProcessorNode.onaudioprocess = function(audioProcessingEvent) {};
|
SDL2.capture.scriptProcessorNode.onaudioprocess = function(audioProcessingEvent) {};
|
||||||
SDL2.capture.scriptProcessorNode.disconnect();
|
SDL2.capture.scriptProcessorNode.disconnect();
|
||||||
SDL2.capture.scriptProcessorNode = undefined;
|
|
||||||
}
|
}
|
||||||
if (SDL2.capture.mediaStreamNode !== undefined) {
|
if (SDL2.capture.mediaStreamNode !== undefined) {
|
||||||
SDL2.capture.mediaStreamNode.disconnect();
|
SDL2.capture.mediaStreamNode.disconnect();
|
||||||
SDL2.capture.mediaStreamNode = undefined;
|
|
||||||
}
|
|
||||||
if (SDL2.capture.silenceBuffer !== undefined) {
|
|
||||||
SDL2.capture.silenceBuffer = undefined
|
|
||||||
}
|
}
|
||||||
SDL2.capture = undefined;
|
SDL2.capture = undefined;
|
||||||
} else {
|
} else {
|
||||||
if (SDL2.audio.scriptProcessorNode != undefined) {
|
if (SDL2.audio.scriptProcessorNode != undefined) {
|
||||||
SDL2.audio.scriptProcessorNode.disconnect();
|
SDL2.audio.scriptProcessorNode.disconnect();
|
||||||
SDL2.audio.scriptProcessorNode = undefined;
|
|
||||||
}
|
}
|
||||||
if (SDL2.audio.silenceTimer !== undefined) {
|
if (SDL2.audio.silenceTimer !== undefined) {
|
||||||
clearInterval(SDL2.audio.silenceTimer);
|
clearInterval(SDL2.audio.silenceTimer);
|
||||||
}
|
}
|
||||||
if (SDL2.audio.silenceBuffer !== undefined) {
|
|
||||||
SDL2.audio.silenceBuffer = undefined
|
|
||||||
}
|
|
||||||
SDL2.audio = undefined;
|
SDL2.audio = undefined;
|
||||||
}
|
}
|
||||||
if ((SDL2.audioContext !== undefined) && (SDL2.audio === undefined) && (SDL2.capture === undefined)) {
|
if ((SDL2.audioContext !== undefined) && (SDL2.audio === undefined) && (SDL2.capture === undefined)) {
|
||||||
|
|
Loading…
Reference in a new issue