diff options
Diffstat (limited to 'src/context')
-rw-r--r-- | src/context/cdmap.h | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/context/cdmap.h b/src/context/cdmap.h index d9cc5b1a3..b7fc5dcc6 100644 --- a/src/context/cdmap.h +++ b/src/context/cdmap.h @@ -340,19 +340,17 @@ public: } void clear() throw(AssertionException) { - Debug("gc") << "clearing cdmap " << this << std::endl; - - Debug("gc") << "cdmap " << this << " cleared, emptying trash" << std::endl; + Debug("gc") << "clearing cdmap " << this << ", emptying trash" << std::endl; emptyTrash(); Debug("gc") << "done emptying trash for " << this << std::endl; - for(typename table_type::iterator i = d_map.begin(); - i != d_map.end(); - ++i) { + for(Element* i = d_first; i != NULL;) { // mark it as being a destruction (short-circuit restore()) - (*i).second->d_map = NULL; - if(!(*i).second->d_noTrash) { - (*i).second->deleteSelf(); + Element* thisOne = i; + i = i->next(); + thisOne->d_map = NULL; + if(!thisOne->d_noTrash) { + thisOne->deleteSelf(); } } d_map.clear(); |