From 9be2d1cc6281c22faa2a92ec35b9bca233a472d6 Mon Sep 17 00:00:00 2001 From: seb777 Date: Thu, 19 Jan 2012 12:41:14 +0100 Subject: [PATCH] It is a good practice to clear container after deleted all the items --- lib/preprocessor.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/preprocessor.cpp b/lib/preprocessor.cpp index c862167f3..8c811cf1b 100644 --- a/lib/preprocessor.cpp +++ b/lib/preprocessor.cpp @@ -2546,7 +2546,7 @@ std::string Preprocessor::expandMacros(const std::string &code, std::string file std::map::iterator it; for (it = macros.begin(); it != macros.end(); ++it) delete it->second; - + macros.clear(); return ""; } @@ -2628,7 +2628,7 @@ std::string Preprocessor::expandMacros(const std::string &code, std::string file std::map::iterator iter; for (iter = macros.begin(); iter != macros.end(); ++iter) delete iter->second; - + macros.clear(); return ""; } @@ -2681,6 +2681,7 @@ std::string Preprocessor::expandMacros(const std::string &code, std::string file for (std::map::iterator it = macros.begin(); it != macros.end(); ++it) delete it->second; + macros.clear(); return ostr.str(); }