From: Matthew Sachs Date: Sun, 17 Feb 2002 04:49:46 +0000 (-0500) Subject: IO::Poll: Removing Handles X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5284b67eb2f74db7dcaf6c897d9c70d6f197e486;p=p5sagit%2Fp5-mst-13.2.git IO::Poll: Removing Handles Message-Id: <20020217094946.GA13130@allevil.dhcp.zevils.com> p4raw-id: //depot/perl@14743 --- diff --git a/ext/IO/lib/IO/Poll.pm b/ext/IO/lib/IO/Poll.pm index 70a3469..89b89d4 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}; } }