summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorMatthew Sachs <matthewg@zevils.com>2002-02-16 23:49:46 -0500
committerAbhijit Menon-Sen <ams@wiw.org>2002-02-18 14:35:38 +0000
commit5284b67eb2f74db7dcaf6c897d9c70d6f197e486 (patch)
treecc5275feb67144b2c79db1d3ab18536756a4b066 /ext
parentd4a8e56c4dba2cdaeeea4c6a0c703df02a2c74b3 (diff)
downloadperl-5284b67eb2f74db7dcaf6c897d9c70d6f197e486.tar.gz
IO::Poll: Removing Handles
Message-Id: <20020217094946.GA13130@allevil.dhcp.zevils.com> p4raw-id: //depot/perl@14743
Diffstat (limited to 'ext')
-rw-r--r--ext/IO/lib/IO/Poll.pm12
1 files changed, 8 insertions, 4 deletions
diff --git a/ext/IO/lib/IO/Poll.pm b/ext/IO/lib/IO/Poll.pm
index 70a3469edb..89b89d4d13 100644
--- a/ext/IO/lib/IO/Poll.pm
+++ b/ext/IO/lib/IO/Poll.pm
@@ -13,7 +13,7 @@ use Exporter ();
our(@ISA, @EXPORT_OK, @EXPORT, $VERSION);
@ISA = qw(Exporter);
-$VERSION = "0.05";
+$VERSION = "0.06";
@EXPORT = qw( POLLIN
POLLOUT
@@ -53,9 +53,13 @@ sub mask {
$self->[1]{$fd} = 0; # output mask
$self->[2]{$io} = $io; # remember handle
} else {
- delete $self->[0]{$fd}{$io};
- delete $self->[1]{$fd} unless %{$self->[0]{$fd}};
- delete $self->[2]{$io};
+ delete $self->[0]{$fd}{$io};
+ unless(%{$self->[0]{$fd}}) {
+ # We no longer have any handles for this FD
+ delete $self->[1]{$fd};
+ delete $self->[0]{$fd};
+ }
+ delete $self->[2]{$io};
}
}