From 26342de04689f7d6c2fc5680b0803f8eb752ec67 Mon Sep 17 00:00:00 2001 From: thelamer Date: Mon, 15 Nov 2021 15:28:16 -0800 Subject: [PATCH] try to help browser garbage collection a bit by null pointing large data arrays --- frontend/js/libretro.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/js/libretro.js b/frontend/js/libretro.js index bcf7b06..090e6fc 100644 --- a/frontend/js/libretro.js +++ b/frontend/js/libretro.js @@ -118,6 +118,7 @@ async function downloadGame(dlGame) { if (rom.split('.').pop() !== 'bin') { var romFile = await downloadFile(EJS_gameUrl); fs.appendFileSync(retroArchDir + 'roms/' + rom, new Buffer(romFile)); + romFile = null; } else { var EJS_gameUrlCue = EJS_gameUrl.split('.').shift() + '.cue'; var cue = rom.split('.').shift() + '.cue'; @@ -125,6 +126,7 @@ async function downloadGame(dlGame) { var romFile = await downloadFile(EJS_gameUrl); fs.appendFileSync(retroArchDir + 'roms/' + cue, new Buffer(cueFile)); fs.appendFileSync(retroArchDir + 'roms/' + rom, new Buffer(romFile)); + romFile = null; }; }; $('#loading').empty();