summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Tanja.pm3
1 files changed, 3 insertions, 0 deletions
diff --git a/Tanja.pm b/Tanja.pm
index a0873f8..fcd72ef 100644
--- a/Tanja.pm
+++ b/Tanja.pm
@@ -216,6 +216,7 @@ sub new {
lasttup => [],
fmti => undef,
fmto => undef,
+ closed => 0,
}, $own;
$s->{write_handle} ||= $s->{handle};
@@ -248,6 +249,7 @@ sub new {
sub _cleanup {
my $s = shift;
+ $s->{closed} = 1;
$s->{node}->_unregister($_) for (values %{$s->{pat}});
$s->{pat} = {};
delete $s->{node}{lnk}{$s};
@@ -271,6 +273,7 @@ sub close {
sub _write {
my $s = shift;
+ return if $s->{closed};
$s->{write_handle}->push_write($s->{fmto} => @_);
$s->{on_write} && $s->{on_write}->(@_);
}