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-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3498a9e168697a061438bb1163bf0bc2ff364545;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;