From 4d62d19187b46962fe6ee2f09f791215cc8e1692 Mon Sep 17 00:00:00 2001 From: "HuYingzhuo(hugo/hyzboy)" Date: Thu, 27 Jul 2023 18:57:17 +0800 Subject: [PATCH] fixed a but that it never delete fis in ParseCSVFile --- inc/hgl/util/csv/CSVParse.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/inc/hgl/util/csv/CSVParse.h b/inc/hgl/util/csv/CSVParse.h index 14db389..86fd045 100644 --- a/inc/hgl/util/csv/CSVParse.h +++ b/inc/hgl/util/csv/CSVParse.h @@ -55,13 +55,10 @@ namespace hgl template inline bool ParseCSVFile(const OSString &filename,CSVParseCallback *pcb) { - io::FileInputStream *fis=new io::FileInputStream; + io::OpenFileInputStream fis(filename); - if(!fis->Open(filename)) - { - delete fis; + if(!fis) return false; - } return ParseCSV(fis,pcb); }