]> Sergey Matveev's repositories - public-inbox.git/blob - lib/PublicInbox/OnDestroy.pm
on_destroy: generic localized END
[public-inbox.git] / lib / PublicInbox / OnDestroy.pm
1 # Copyright (C) 2020 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
3
4 package PublicInbox::OnDestroy;
5
6 sub new {
7         shift; # ($class, $cb, @args)
8         bless [ @_ ], __PACKAGE__;
9 }
10
11 sub DESTROY {
12         my ($cb, @args) = @{$_[0]};
13         $cb->(@args) if $cb;
14 }
15
16 1;