1 # subclass Mail::Thread and use this to workaround a memory leak
2 # Based on the patch in: https://rt.cpan.org/Public/Bug/Display.html?id=22817
3 # License differs from the rest of public-inbox (but is compatible):
4 # This library is free software; you can redistribute it and/or modify
5 # it under the same terms as Perl itself.
6 package PublicInbox::Thread;
9 use base qw(Mail::Thread);
11 if ($Mail::Thread::VERSION <= 2.55) {
12 eval q(sub _container_class { 'PublicInbox::Thread::Container' });
15 package PublicInbox::Thread::Container;
18 use base qw(Mail::Thread::Container);
19 use Scalar::Util qw(weaken);
20 sub parent { @_ == 2 ? weaken($_[0]->{parent} = $_[1]) : $_[0]->{parent} }