Skip to content

Commit 11bdc64

Browse files
committed
fix: streams call callback when destorying
This is a possible bug leading to issues with #72?
1 parent 870e14d commit 11bdc64

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/streams/ReadStream.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ class ReadStream extends Readable {
121121
if (this._fd) {
122122
this._fs.close(this._fd, (err_) => {
123123
this._error(err_ || err);
124+
callback(err_);
124125
});
125126
} else {
126127
callback(err);

src/streams/WriteStream.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ class WriteStream extends Writable {
136136
if (this._fd) {
137137
this._fs.close(this._fd, (err_) => {
138138
this._error(err_ || err);
139+
callback(err_);
139140
});
140141
} else {
141142
callback(err);

0 commit comments

Comments
 (0)