From fd0a6e09f4b0d38de77c19226392c33b2a69077a Mon Sep 17 00:00:00 2001 From: Lion Date: Wed, 20 Jul 2022 16:38:43 +0800 Subject: [PATCH] auto close the handle after buffer loaded --- binding/php/XdbSearcher.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/binding/php/XdbSearcher.class.php b/binding/php/XdbSearcher.class.php index df8816e..f743198 100644 --- a/binding/php/XdbSearcher.class.php +++ b/binding/php/XdbSearcher.class.php @@ -267,7 +267,9 @@ class XdbSearcher return null; } - return self::loadHeader($handle); + $header = self::loadHeader($handle); + fclose($handle); + return $header; } // load vector index from a file handle @@ -296,7 +298,9 @@ class XdbSearcher return null; } - return self::loadVectorIndex($handle); + $vIndex = self::loadVectorIndex($handle); + fclose($handle); + return $vIndex; } // load the xdb content from a file handle