Skip to content

Commit f9e4369

Browse files
authored
fix: always close file handles to stdout/stderr logs (#259)
1 parent f1baa9a commit f9e4369

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
@@ -415,16 +415,16 @@ class Launcher {
415415
}
416416

417417
destroyTmp() {
418-
// Only clean up the tmp dir if we created it.
419-
if (this.userDataDir === undefined || this.opts.userDataDir !== undefined) {
420-
return;
421-
}
422-
423418
if (this.outFile) {
424419
this.fs.closeSync(this.outFile);
425420
delete this.outFile;
426421
}
427422

423+
// Only clean up the tmp dir if we created it.
424+
if (this.userDataDir === undefined || this.opts.userDataDir !== undefined) {
425+
return;
426+
}
427+
428428
if (this.errFile) {
429429
this.fs.closeSync(this.errFile);
430430
delete this.errFile;

0 commit comments

Comments
 (0)