From b6e8fcd9bc081ffc2a319f4f13add0e84d06fa36 Mon Sep 17 00:00:00 2001 From: xororz Date: Mon, 15 Apr 2024 08:41:15 -0400 Subject: [PATCH] optimize performance --- src/App.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/App.vue b/src/App.vue index 43f42d8..b8a49fa 100644 --- a/src/App.vue +++ b/src/App.vue @@ -650,6 +650,10 @@ export default { targetPtr + outputArray.length ) ); + wasmModule._free(sourcePtr); + wasmModule._free(targetPtr); + wasmModule = null; + this.wasmModule = null; } const imgCanvas = this.$refs.imgCanvas; @@ -662,6 +666,9 @@ export default { this.output.height ); outImg.data.set(this.output.data); + this.input = null; + this.inputAlpha = null; + this.output = null; imgCtx.putImageData(outImg, 0, 0); let type = "image/jpeg"; let quality = 0.92;