our(@ISA, @EXPORT_OK, @EXPORT, $VERSION);
@ISA = qw(Exporter);
-$VERSION = "0.05";
+$VERSION = "0.06";
@EXPORT = qw( POLLIN
POLLOUT
$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};
}
}