From 03718f44e002669e8b94561d95ad00bd1a51a1ef Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Sat, 27 Aug 2011 18:49:35 -0400 Subject: [PATCH] Reset the container after deleting all the elements. otherwise the size of the containers stays the same but the elements hold references to items that have been deleted. It causes crashes if close is called more than once. --- trace_parser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/trace_parser.cpp b/trace_parser.cpp index 47d5a7a..44d1786 100644 --- a/trace_parser.cpp +++ b/trace_parser.cpp @@ -84,9 +84,10 @@ deleteAll(Iter begin, Iter end) template inline void -deleteAll(const Container &c) +deleteAll(Container &c) { deleteAll(c.begin(), c.end()); + c.clear(); } void Parser::close(void) { -- 2.43.0