From 0b271e70401bd7c059d10e2ec8fc802cf0aa9838 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 1 May 2014 02:30:00 +0000 Subject: workaround Mail::Thread memory leak Thanks to Ask for the patch in https://rt.cpan.org/Public/Bug/Display.html?id=22817 --- MANIFEST | 1 + lib/PublicInbox/Feed.pm | 6 ++---- lib/PublicInbox/Thread.pm | 19 +++++++++++++++++++ lib/PublicInbox/WWW.pm | 2 +- 4 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 lib/PublicInbox/Thread.pm diff --git a/MANIFEST b/MANIFEST index ad611e5d..4c3b07df 100644 --- a/MANIFEST +++ b/MANIFEST @@ -25,6 +25,7 @@ lib/PublicInbox/GitCatFile.pm lib/PublicInbox/Hval.pm lib/PublicInbox/MDA.pm lib/PublicInbox/View.pm +lib/PublicInbox/Thread.pm lib/PublicInbox/WWW.pm public-inbox-learn public-inbox-mda diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm index 6b317ab0..a507cda1 100644 --- a/lib/PublicInbox/Feed.pm +++ b/lib/PublicInbox/Feed.pm @@ -13,8 +13,6 @@ use constant { MAX_PER_PAGE => 25, }; -# FIXME: workaround https://rt.cpan.org/Public/Bug/Display.html?id=22817 - # main function sub generate { my ($class, $args) = @_; @@ -50,7 +48,7 @@ sub generate { sub generate_html_index { my ($class, $args) = @_; - require Mail::Thread; + require PublicInbox::Thread; my $max = $args->{max} || MAX_PER_PAGE; my $feed_opts = get_feedopts($args); @@ -72,7 +70,7 @@ sub generate_html_index { }); $git = undef; # destroy pipes. - my $th = Mail::Thread->new(@messages); + my $th = PublicInbox::Thread->new(@messages); $th->thread; my $html = "$title" . '