[libmail-thread-perl] 07/10: Add memory-leak.patch to fix a memory leak.

gregor herrmann gregoa at debian.org
Wed Oct 1 19:59:11 UTC 2014


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

gregoa pushed a commit to branch master
in repository libmail-thread-perl.

commit 206a7b0d946df0bfa0051e4b3be438b0c76e467b
Author: gregor herrmann <gregoa at debian.org>
Date:   Wed Oct 1 21:51:48 2014 +0200

    Add memory-leak.patch to fix a memory leak.
    
    Closes: #763403
    Thanks: Eric Wong for filing the bug and providing the pointer to the patch.
---
 debian/patches/memory-leak.patch | 77 ++++++++++++++++++++++++++++++++++++++++
 debian/patches/series            |  1 +
 2 files changed, 78 insertions(+)

diff --git a/debian/patches/memory-leak.patch b/debian/patches/memory-leak.patch
new file mode 100644
index 0000000..39cdc73
--- /dev/null
+++ b/debian/patches/memory-leak.patch
@@ -0,0 +1,77 @@
+Description: memory leak/cycle fix
+Origin: CPAN RT
+Bug: https://rt.cpan.org/Public/Bug/Display.html?id=22817
+Bug-Debian: http.s//bugs.debian.org/763403
+Author: ABH [...] cpan.org
+Reviewed-by: gregor herrmann <gregoa at debian.org>
+Last-Update: 2014-10-01
+
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -5,6 +5,7 @@
+     'VERSION_FROM'	=> 'Thread.pm',
+     'PREREQ_PM'		=> { 
+ 			'Test::More' => 0,
++			'Scalar::Util' => 0,
+       'Email::Abstract' => 0 ,
+ 		},
+     ABSTRACT_FROM => 'Thread.pm',
+--- a/Thread.pm
++++ b/Thread.pm
+@@ -316,12 +316,13 @@
+ 
+ package Mail::Thread::Container;
+ use Carp qw(carp confess croak cluck);
++use Scalar::Util qw(weaken);
+ 
+ sub new { my $self = shift; bless { id => shift }, $self; }
+ 
+ sub message { $_[0]->{message} = $_[1] if @_ == 2; $_[0]->{message} }
++sub parent  { @_ == 2 ? weaken($_[0]->{parent} = $_[1]) : $_[0]->{parent} }
+ sub child   { $_[0]->{child}   = $_[1] if @_ == 2; $_[0]->{child}   }
+-sub parent  { $_[0]->{parent}  = $_[1] if @_ == 2; $_[0]->{parent}  }
+ sub next    { $_[0]->{next}    = $_[1] if @_ == 2; $_[0]->{next}    }
+ sub messageid { $_[0]->{id}      = $_[1] if @_ == 2; $_[0]->{id}      }
+ sub subject { $_[0]->header("subject") }
+--- a/t/1.t
++++ b/t/1.t
+@@ -1,7 +1,7 @@
+ #!perl -w
+ BEGIN { require 't/common.pl' }
+ 
+-use Test::More tests => 3;
++use Test::More tests => 4;
+ use_ok("Mail::Thread");
+ 
+ my $threader = new Mail::Thread( slurp_messages('t/testbox') );
+@@ -15,6 +15,12 @@
+ 
+ is($threader->rootset, 3, "We have three main threads");
+ 
++eval "use Test::Memory::Cycle";
++SKIP: {
++	skip "Test::Memory::Cycle not available", 1 if $@;
++	memory_cycle_ok($threader, 'threader not cycled');
++}
++
+ my @stuff;
+ dump_into($threader => \@stuff);
+ 
+--- /dev/null
++++ b/t/6-cycle.t
+@@ -0,0 +1,15 @@
++#!perl -w
++BEGIN { require 't/common.pl' }
++
++use Test::More;
++eval "use Test::Memory::Cycle";
++plan skip_all => "Test::Memory::Cycle required for this test" if $@;
++plan tests => 2;
++
++use_ok("Mail::Thread");
++
++my $threader = new Mail::Thread(slurp_messages('t/testbox-6'));
++$threader->thread;
++
++memory_cycle_ok($threader, 'threader not cycled');
++
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..188e01e
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+memory-leak.patch

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



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