From: Tyler Riddle Date: Fri, 30 Nov 2012 21:20:33 +0000 (-0800) Subject: fix warning if handle is DEMOLISHED after the backing connection is gone X-Git-Tag: v0.003001_01~55 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=82ef4e4bbc6e05ab1f8fe2a71374907f16fb947a;p=scpubgit%2FObject-Remote.git fix warning if handle is DEMOLISHED after the backing connection is gone --- diff --git a/lib/Object/Remote/Handle.pm b/lib/Object/Remote/Handle.pm index 7e9c218..e68aae9 100644 --- a/lib/Object/Remote/Handle.pm +++ b/lib/Object/Remote/Handle.pm @@ -86,7 +86,11 @@ sub DEMOLISH { my ($self, $gd) = @_; Dlog_trace { "Demolishing remote handle $_" } $self->id; return if $gd or $self->disarmed_free; - $self->connection->send_free($self->id); + #this could happen after the connection has gone away + eval { $self->connection->send_free($self->id) }; + if ($@ && $@ !~ m/^Attempt to invoke _send on a connection that is not valid/) { + die "Could not invoke send_free on connection for handle " . $self->id; + } } 1;