Skip to content

Commit 3bec568

Browse files
committed
fix: always close file handles to stdout/stderr logs
1 parent 279577f commit 3bec568

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/chrome-launcher.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -405,11 +405,6 @@ class Launcher {
405405

406406
destroyTmp() {
407407
return new Promise<void>(resolve => {
408-
// Only clean up the tmp dir if we created it.
409-
if (this.userDataDir === undefined || this.opts.userDataDir !== undefined) {
410-
return resolve();
411-
}
412-
413408
if (this.outFile) {
414409
this.fs.closeSync(this.outFile);
415410
delete this.outFile;
@@ -420,6 +415,11 @@ class Launcher {
420415
delete this.errFile;
421416
}
422417

418+
// Only clean up the tmp dir if we created it.
419+
if (this.userDataDir === undefined || this.opts.userDataDir !== undefined) {
420+
return resolve();
421+
}
422+
423423
// backwards support for node v12 + v14.14+
424424
// https://nodejs.org/api/deprecations.html#DEP0147
425425
const rm = this.fs.rm || this.fs.rmdir;

0 commit comments

Comments
 (0)