diff --git a/test/codesize/test_minimal_runtime_code_size_audio_worklet.json b/test/codesize/test_minimal_runtime_code_size_audio_worklet.json index 981710d42f492..d4904dbec2e14 100644 --- a/test/codesize/test_minimal_runtime_code_size_audio_worklet.json +++ b/test/codesize/test_minimal_runtime_code_size_audio_worklet.json @@ -3,8 +3,8 @@ "a.html.gz": 357, "a.js": 4077, "a.js.gz": 2137, - "a.wasm": 1298, - "a.wasm.gz": 868, - "total": 5894, - "total_gz": 3362 + "a.wasm": 1308, + "a.wasm.gz": 876, + "total": 5904, + "total_gz": 3370 } diff --git a/test/webaudio/audioworklet.c b/test/webaudio/audioworklet.c index 964b30ddad5da..883834b3843d7 100644 --- a/test/webaudio/audioworklet.c +++ b/test/webaudio/audioworklet.c @@ -20,6 +20,8 @@ begin to fire. */ +EMSCRIPTEN_WEBAUDIO_T context; + // TEST_AND_EXIT is defined when running in the Emscripten test harness. You can // strip these out in your own project (otherwise playback will end quickly). #ifdef TEST_AND_EXIT @@ -70,6 +72,7 @@ bool main_thread_tls_access(double time, void *userData) { testTlsVariable = (int)time; // Exit to the test harness after enough calls to ProcessAudio() if (lastTlsVariableValueInAudioThread >= 100) { + emscripten_destroy_audio_context(context); emscripten_force_exit(0); } return true; @@ -128,7 +131,7 @@ int main() { assert(!emscripten_current_thread_is_audio_worklet()); // Create an audio context - EMSCRIPTEN_WEBAUDIO_T context = emscripten_create_audio_context(0 /* use default constructor options */); + context = emscripten_create_audio_context(0 /* use default constructor options */); // and kick off Audio Worklet scope initialization, which shares the Wasm // Module and Memory to the AudioWorklet scope and initializes its stack.