mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-21 00:12:58 +02:00
location-functions.pl: Add END block to release the database handle.
Reference #12515. Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org> Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
committed by
Michael Tremer
parent
b62d7e0cc7
commit
f46fd07814
@@ -218,4 +218,14 @@ sub address_has_flags($) {
|
||||
return @flags;
|
||||
}
|
||||
|
||||
# Custom END declaration which will be executed when perl
|
||||
# ends, to release the database handle to libloc.
|
||||
END {
|
||||
# Check if a database handle exists.
|
||||
if ($db_handle) {
|
||||
# Destroy libloc database handle.
|
||||
&Location::DESTROY($db_handle);
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
Reference in New Issue
Block a user