From 5b28980a0544adf56b9b4b0bbc6125e888233e3c Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Tue, 12 Aug 2014 19:52:12 +0200 Subject: [PATCH] Pcbnew, Cvpcb: fix Bug #1355883 . Due to a missing call to a delete operator in CMP_READER class (also creates memory leak). --- pcbnew/netlist_reader.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pcbnew/netlist_reader.h b/pcbnew/netlist_reader.h index 3db2236003..9774d9462f 100644 --- a/pcbnew/netlist_reader.h +++ b/pcbnew/netlist_reader.h @@ -55,11 +55,26 @@ class CMP_READER LINE_READER* m_lineReader; ///< The line reader to read. public: + /** + * CMP_READER constructor. + * @param aLineReader is a LINE_READER (in fact a FILE_LINE_READER) + * which is owned by me ( and deleted by me) to read + * the component footprint link file. + */ CMP_READER( LINE_READER* aLineReader ) { m_lineReader = aLineReader; } + ~CMP_READER() + { + if( m_lineReader ) + { + delete m_lineReader; + m_lineReader = NULL; + } + } + /** * Function Load * read the *.cmp file format contains the component footprint assignments created by CvPcb