[libanyevent-rabbitmq-perl] 48/151: Add extra paranoia WRT global destruction

Damyan Ivanov dmn at moszumanska.debian.org
Thu Jan 16 11:03:03 UTC 2014


This is an automated email from the git hooks/post-receive script.

dmn pushed a commit to annotated tag debian/1.12-1
in repository libanyevent-rabbitmq-perl.

commit f2e20acc2aa30280c74c11eb0d7921315573ce87
Author: Tomas Doran (t0m) <t0m at state51.co.uk>
Date:   Thu Mar 25 13:13:03 2010 +0000

    Add extra paranoia WRT global destruction
---
 Changes                  | 3 +++
 lib/AnyEvent/RabbitMQ.pm | 7 +++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/Changes b/Changes
index 3b05077..18dd92b 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 Revision history for Perl extension RabbitFoot
 
+        - Fix errors in global destruction due to destruction order being
+          random.
+
 1.01    Sun Mar 18 07:21:58 2010
         - fix bugs.
         - support channel.flow.
diff --git a/lib/AnyEvent/RabbitMQ.pm b/lib/AnyEvent/RabbitMQ.pm
index 37b7411..38015a4 100644
--- a/lib/AnyEvent/RabbitMQ.pm
+++ b/lib/AnyEvent/RabbitMQ.pm
@@ -281,7 +281,9 @@ sub close {
     }
 
     for my $id (keys %{$self->{_channels}}) {
-         $self->{_channels}->{$id}->close(
+         my $channel = $self->{_channels}->{$id}
+            or next; # Could have already gone away on global destruction..
+         $channel->close(
             on_success => $close_cb,
             on_failure => sub {
                 $close_cb->();
@@ -425,7 +427,8 @@ sub _push_write {
         warn '[C] --> [S] ', Dumper($output);
     }
 
-    $self->{_handle}->push_write($output->to_raw_frame());
+    $self->{_handle}->push_write($output->to_raw_frame())
+        if $self->{_handle}; # Careful - could have gone (global destruction)
     return;
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libanyevent-rabbitmq-perl.git



More information about the Pkg-perl-cvs-commits mailing list