FIX GC cause generate error

This commit is contained in:
2024-06-08 14:51:16 +08:00
parent cea0316679
commit 71c831133f

View File

@@ -65,9 +65,11 @@ export async function gen_thumbnail(
quality: number, quality: number,
) { ) {
const t = new TextEncoder(); const t = new TextEncoder();
const s = t.encode(`${src}\0`);
const d = t.encode(`${dest}\0`);
const ore = await lib.symbols.gen_thumbnail( const ore = await lib.symbols.gen_thumbnail(
t.encode(`${src}\0`), s,
t.encode(`${dest}\0`), d,
width, width,
height, height,
method, method,
@@ -75,6 +77,8 @@ export async function gen_thumbnail(
quality, quality,
); );
const re = _Result.unpack(ore); const re = _Result.unpack(ore);
s;
d;
if (re.e) return get_error(ore); if (re.e) return get_error(ore);
return; return;
} }