Subject: | [PATCH 0.1100 Generic.pm] Fix leaking sockets on shutdown |
Date: | Wed, 11 Mar 2009 14:38:49 +0000 |
To: | bug-POE-Component-Generic [...] rt.cpan.org |
From: | Paul Williams <cpan [...] it.alldaypa.com> |
Hi,
I noticed sockets weren't being closed down in my POE daemon which opens
and closes many PoCo::Generic objects. I've attached a patch to address
the POE::Wheel::Run sockets, which aren't closed when you shutdown an
object.
It's a very simple patch which deletes the wheel, cleaning up the open
sockets in the shutdown() method -
if ($self->{wheel}) {
$self->{wheel}->shutdown_stdin;
+ delete $self->{wheel};
}
I hope this is helpful and I can only apologise if I have patched
incorrectly!
Thanks,
-Paul
--- a/Generic.pm 2009-03-11 13:30:53.000000000 +0000
+++ b/Generic.pm 2009-03-11 13:31:35.000000000 +0000
@@ -739,6 +739,7 @@
if ($self->{wheel}) {
$self->{wheel}->shutdown_stdin;
+ delete $self->{wheel};
}
undef;
}
@@ -1481,4 +1482,4 @@
=cut
-
\ No newline at end of file
+