CC: | i.arbeca [...] gmail.com |
Subject: | (in cleanup) Can't call method "free" on an undefined value |
Hi,
I am using Perl module Gungho, which relies on
POE::Component::Connection::Keepalive. Sometimes I have the following
error :
(in cleanup) Can't call method "free" on an undefined value at
/usr/local/share/perl/5.10.1/POE/Component/Connection/Keepalive.pm line
42 during global destruction.
Here is the sample code :
sub DESTROY {
my $self = shift;
$self->[CK_WHEEL] = undef;
$self->[CK_MANAGER]->free($self->[CK_SOCKET]); ### line 42
}
Replacing
$self->[CK_MANAGER]->free($self->[CK_SOCKET]);
by
$self->[CK_MANAGER] && $self->[CK_MANAGER]->free($self->[CK_SOCKET]);
solves the problem.
Or can the problem be solved otherwise ?
Regards
Isabelle Cabrera