[libanyevent-rabbitmq-perl] 109/151: More thoroughly eliminate memory leaks on incoming messages

Damyan Ivanov dmn at moszumanska.debian.org
Thu Jan 16 11:03:08 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 b2d8a30b4f2ed0a0437816b71bc6a981e3d38924
Author: Chip Salzenberg <chip at topsy.com>
Date:   Sun Aug 26 17:46:01 2012 -0700

    More thoroughly eliminate memory leaks on incoming messages
---
 lib/AnyEvent/RabbitMQ/Channel.pm | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/AnyEvent/RabbitMQ/Channel.pm b/lib/AnyEvent/RabbitMQ/Channel.pm
index ae25a39..0bfbbe6 100644
--- a/lib/AnyEvent/RabbitMQ/Channel.pm
+++ b/lib/AnyEvent/RabbitMQ/Channel.pm
@@ -654,7 +654,8 @@ sub _push_read_header_and_body {
     });
 
     my $body_payload = "";
-    my $next_frame; $next_frame = sub {
+    my $w_next_frame;
+    my $next_frame = sub {
         my $frame = shift;
 
         return $failure_cb->('Received data is not body frame')
@@ -664,15 +665,16 @@ sub _push_read_header_and_body {
 
         if (length($body_payload) < $body_size) {
             # More to come
-            $self->{_content_queue}->get($next_frame);
+            $self->{_content_queue}->get($w_next_frame);
         }
         else {
-            undef $next_frame;
             $frame->payload($body_payload);
             $response->{body} = $frame;
             $cb->($response);
         }
     };
+    $w_next_frame = $next_frame;
+    weaken($w_next_frame);
 
     $self->{_content_queue}->get($next_frame);
 

-- 
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