Skip to content

Commit 687602d

Browse files
committed
Close the underlying stream when closing the stream
1 parent bd19f2f commit 687602d

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/WritableResourceStream.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,16 @@ public function close()
9494

9595
$this->emit('close', array($this));
9696
$this->removeAllListeners();
97+
98+
$this->handleClose();
99+
}
100+
101+
/** @internal */
102+
public function handleClose()
103+
{
104+
if (is_resource($this->stream)) {
105+
fclose($this->stream);
106+
}
97107
}
98108

99109
/** @internal */

0 commit comments

Comments
 (0)