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:
parent
a37ebef071
commit
ca3ab2dc73
@ -120,4 +120,10 @@ class ResourceInputStream implements InputStream {
|
||||
public function getResource() {
|
||||
return $this->resource;
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
if ($this->resource !== null) {
|
||||
$this->close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -208,4 +208,10 @@ class ResourceOutputStream implements OutputStream {
|
||||
public function getResource() {
|
||||
return $this->resource;
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
if ($this->resource !== null) {
|
||||
$this->close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user