From d55638362727fd03d0ad97f9fe937984f9456e1b Mon Sep 17 00:00:00 2001 From: Hao Wu Date: Mon, 10 Oct 2016 20:40:38 +0800 Subject: [PATCH 1/1] BaseTools/VfrCompile/Pccts: Add virtual destructor for class DLGInputStream Class DLGInputStream defined in DLexerBase.h has a virtual method but no virtual destructor. This commit add an empty virtual destructor to avoid potential memory/resource leak when an object of a class derived from class DLGInputStream is deleted through a pointer to the DLGInputStream class. Cc: Liming Gao Cc: Yonghong Zhu Cc: Eric Dong Cc: Dandan Bi Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu Reviewed-by: Liming Gao --- BaseTools/Source/C/VfrCompile/Pccts/h/DLexerBase.h | 1 + 1 file changed, 1 insertion(+) diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/DLexerBase.h b/BaseTools/Source/C/VfrCompile/Pccts/h/DLexerBase.h index 667ecfd81a..b9ca311baa 100644 --- a/BaseTools/Source/C/VfrCompile/Pccts/h/DLexerBase.h +++ b/BaseTools/Source/C/VfrCompile/Pccts/h/DLexerBase.h @@ -57,6 +57,7 @@ public: class DllExportPCCTS DLGInputStream { public: virtual int nextChar() = 0; + virtual ~DLGInputStream() {}; }; /* Predefined char stream: Input from FILE */ -- 2.39.2