Skip to content

Commit b26b4d4

Browse files
close the stream only when not transferred (fix #493)
1 parent a264975 commit b26b4d4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Diff for: lib/core/codec-worker.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,12 @@ async function runWebWorker(workerData, config) {
205205
});
206206
}
207207
const resultValue = await result;
208-
try {
209-
await writable.getWriter().close();
210-
} catch (_error) {
211-
// ignored
208+
if (!streamsTransferred) {
209+
try {
210+
const writer = writable.getWriter().close();
211+
} catch (_error) {
212+
// ignored
213+
}
212214
}
213215
await closed;
214216
return resultValue;

0 commit comments

Comments
 (0)