projects
/
tools
/
apitrace.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2d0d838
)
Reset the container after deleting all the elements.
author
Zack Rusin
<zack@kde.org>
Sat, 27 Aug 2011 22:49:35 +0000
(18:49 -0400)
committer
Zack Rusin
<zack@kde.org>
Sat, 27 Aug 2011 22:49:35 +0000
(18:49 -0400)
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
patch
|
blob
|
history
diff --git
a/trace_parser.cpp
b/trace_parser.cpp
index
47d5a7a
..
44d1786
100644
(file)
--- a/
trace_parser.cpp
+++ b/
trace_parser.cpp
@@
-84,9
+84,10
@@
deleteAll(Iter begin, Iter end)
template <typename Container>
inline void
-deleteAll(
const
Container &c)
+deleteAll(Container &c)
{
deleteAll(c.begin(), c.end());
+ c.clear();
}
void Parser::close(void) {