fix memory getting rewritten before it's received by js

This commit is contained in:
Andrew Morris
2025-01-30 16:17:50 +11:00
parent 162a1f8940
commit fbea53b627

View File

@@ -198,7 +198,7 @@ EM_JS(void, handle_output_bits_raw, (uint8_t* outputBits, int length), {
const outputBitsArray = new Uint8Array(Module.HEAPU8.buffer, outputBits, length);
// Call the JavaScript function with the output bits
Module.emp.handleOutput(outputBitsArray);
Module.emp.handleOutput(outputBitsArray.slice());
});
EM_JS(void, handle_error, (const char* message), {