We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b0cc8cc commit 71b77fbCopy full SHA for 71b77fb
1 file changed
packages/emnapi/src/threadsafe-function.ts
@@ -157,6 +157,12 @@ export const emnapiTSFN = {
157
destroyQueue (func: number) {
158
const queue = emnapiTSFN.loadSizeTypeValue(func + emnapiTSFN.offset.queue, false)
159
if (queue) {
160
+ let node = emnapiTSFN.loadSizeTypeValue(queue, false)
161
+ while (node !== 0) {
162
+ const next = emnapiTSFN.loadSizeTypeValue(node + POINTER_SIZE, false)
163
+ _free(to64('node') as number)
164
+ node = next
165
+ }
166
_free(to64('queue') as number)
167
}
168
},
@@ -616,6 +622,7 @@ export const emnapiTSFN = {
616
622
return
617
623
618
624
emnapiTSFN.setHandlesClosing(func, 1)
625
+ Atomics.store(new Int32Array(wasmMemory.buffer), (func + emnapiTSFN.offset.async_pending) >>> 2, 1)
619
626
emnapiCtx.feature.setImmediate(() => {
620
627
emnapiTSFN.finalize(func)
621
628
})
0 commit comments