From patchwork Sat Nov 7 18:47:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 3648 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4CT5q12dG5z3wlL for ; Sat, 7 Nov 2020 18:47:41 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4CT5py3Rbwz1mm; Sat, 7 Nov 2020 18:47:38 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4CT5px5WRjz2yfh; Sat, 7 Nov 2020 18:47:37 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4CT5pw3jDRz2xGb for ; Sat, 7 Nov 2020 18:47:36 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4CT5pw1HVfzv9; Sat, 7 Nov 2020 18:47:36 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1604774856; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jawETcxq2NWCY9YP9uIbPFEs81CoYGukEIxumppXul0=; b=nNlPWEXdmvomEzQNft84GwCV2qrLVZY2AYz3G15a5F5y2tPPWQSswt2TGl7vUUdOBByK1X j+BXh0FD4EsnYFCg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1604774856; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jawETcxq2NWCY9YP9uIbPFEs81CoYGukEIxumppXul0=; b=uNKLV/nlPTOs6PUHvCbcwqMygKv7MWTVuO1nvcm4JbDzwziVziQG/IQYXaAOGNbYMt8KDV tJncPcooX1xUtb4rLo02TKmDbFi7aN06lzZ5S/DnulwIWyz2gD85DlYf9l+Pj8Mr2ZlYnN R0lGlAcXrB+wAt2CmQemlak9fPqAXsHzPTVfQAyXBtbyyfkU39bmKsDW6Ind/PbBj1/uOw KJLalY6GZFv3/QmusssgxGiptqdDASnHyND4WGaODUaOP8/dZPsPMGu+xWO+wHxFudWC/8 /Tg11csKNP4RUe72EbR6XCZ5kcPeMKMvshE1KXEU0Ya3ZKJGXyxtWSaGdazFgA== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 2/5] location-functions.pl: Add END block to release the database handle. Date: Sat, 7 Nov 2020 19:47:21 +0100 Message-Id: <20201107184724.3590-2-stefan.schantl@ipfire.org> In-Reply-To: <20201107184724.3590-1-stefan.schantl@ipfire.org> References: <20201107184724.3590-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Reference #12515. Signed-off-by: Stefan Schantl --- config/cfgroot/location-functions.pl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config/cfgroot/location-functions.pl b/config/cfgroot/location-functions.pl index 9b1d0bfb5..483703016 100644 --- a/config/cfgroot/location-functions.pl +++ b/config/cfgroot/location-functions.pl @@ -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;