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 e1b47b4 commit 72b6ea3Copy full SHA for 72b6ea3
1 file changed
packages/emnapi/src/threadsafe-function.ts
@@ -173,6 +173,12 @@ const emnapiTSFN = {
173
destroyQueue (func: number) {
174
const queue = emnapiTSFN.loadSizeTypeValue(func + emnapiTSFN.offset.queue, false)
175
if (queue) {
176
+ let node = emnapiTSFN.loadSizeTypeValue(queue, false)
177
+ while (node !== 0) {
178
+ const next = emnapiTSFN.loadSizeTypeValue(node + POINTER_SIZE, false)
179
+ _free(to64('node') as number)
180
+ node = next
181
+ }
182
_free(to64('queue') as number)
183
}
184
},
@@ -631,6 +637,7 @@ const emnapiTSFN = {
631
637
return
632
638
633
639
emnapiTSFN.setHandlesClosing(func, 1)
640
+ Atomics.store(new Int32Array(wasmMemory.buffer), (func + emnapiTSFN.offset.async_pending) >>> 2, 1)
634
641
emnapiCtx.features.setImmediate(() => {
635
642
emnapiTSFN.finalize(func)
636
643
})
0 commit comments