Free memory after taking screenshot in the app

This commit is contained in:
redphx 2024-03-24 16:13:39 +07:00
parent 4376f37bd0
commit 244bebba01

View File

@ -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;
}