about summary refs log tree commit homepage
path: root/lib/PublicInbox/MHreader.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/MHreader.pm')
-rw-r--r--lib/PublicInbox/MHreader.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/MHreader.pm b/lib/PublicInbox/MHreader.pm
index 3e7bbd5c..16e505a2 100644
--- a/lib/PublicInbox/MHreader.pm
+++ b/lib/PublicInbox/MHreader.pm
@@ -52,7 +52,7 @@ EOM
 sub mh_each_file {
         my ($self, $efcb, @arg) = @_;
         opendir(my $dh, my $dir = $self->{dir});
-        my $restore = PublicInbox::OnDestroy->new($$, \&chdir, $self->{cwdfh});
+        my $restore = on_destroy \&chdir, $self->{cwdfh};
         chdir($dh);
         my $sort = $self->{sort};
         if (defined $sort && "@$sort" ne 'none') {
@@ -96,7 +96,7 @@ sub mh_each_eml {
 
 sub mh_read_one {
         my ($self, $n, $ucb, @arg) = @_;
-        my $restore = PublicInbox::OnDestroy->new($$, \&chdir, $self->{cwdfh});
+        my $restore = on_destroy \&chdir, $self->{cwdfh};
         chdir(my $dir = $self->{dir});
         _file2eml($dir, $n, $self, $ucb, @arg);
 }