From 91766bc4fe3e009c5c322ee3e3abd32cdb8ab01a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 29 Jan 2019 21:35:25 +0000 Subject: viewvcs: avoid segfault with highlight.pm at shutdown Proper ordering of destruction seems required to avoid segfaults at shutdown. --- lib/PublicInbox/ViewVCS.pm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/PublicInbox/ViewVCS.pm') diff --git a/lib/PublicInbox/ViewVCS.pm b/lib/PublicInbox/ViewVCS.pm index 63e503d8..85edf22f 100644 --- a/lib/PublicInbox/ViewVCS.pm +++ b/lib/PublicInbox/ViewVCS.pm @@ -26,6 +26,11 @@ my $hl = eval { PublicInbox::HlMod->new; }; +# we need to trigger highlight::CodeGenerator::deleteInstance +# in HlMod::DESTROY before the rest of Perl shuts down to avoid +# a segfault at shutdown +END { $hl = undef }; + my %QP_MAP = ( A => 'oid_a', B => 'oid_b', a => 'path_a', b => 'path_b' ); my $max_size = 1024 * 1024; # TODO: configurable my $enc_utf8 = find_encoding('UTF-8'); -- cgit v1.2.3-24-ge0c7