1
0
mirror of https://github.com/danog/byte-stream.git synced 2024-11-26 20:04:51 +01:00

Restore destructor on resource stream

Forgot close() needed to be called to free watcher.
This commit is contained in:
Aaron Piotrowski 2017-05-12 10:27:58 -05:00
parent a37ebef071
commit ca3ab2dc73
2 changed files with 12 additions and 0 deletions

View File

@ -120,4 +120,10 @@ class ResourceInputStream implements InputStream {
public function getResource() {
return $this->resource;
}
public function __destruct() {
if ($this->resource !== null) {
$this->close();
}
}
}

View File

@ -208,4 +208,10 @@ class ResourceOutputStream implements OutputStream {
public function getResource() {
return $this->resource;
}
public function __destruct() {
if ($this->resource !== null) {
$this->close();
}
}
}