From 244bebba01df7ff225138a296b38d48e65fa6179 Mon Sep 17 00:00:00 2001 From: redphx <96280+redphx@users.noreply.github.com> Date: Sun, 24 Mar 2024 16:13:39 +0700 Subject: [PATCH] Free memory after taking screenshot in the app --- better-xcloud.user.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/better-xcloud.user.js b/better-xcloud.user.js index 900543e..df07096 100644 --- a/better-xcloud.user.js +++ b/better-xcloud.user.js @@ -11380,6 +11380,10 @@ function takeScreenshot(callback) { if (AppInterface) { const data = $SCREENSHOT_CANVAS.toDataURL('image/png').split(';base64,')[1]; AppInterface.saveScreenshot(GAME_TITLE_ID, data); + + // Free screenshot from memory + $canvasContext.clearRect(0, 0, $SCREENSHOT_CANVAS.width, $SCREENSHOT_CANVAS.height); + callback && callback(); return; }