diff options
Diffstat (limited to 'libxsde/xsde/cxx/parser')
-rw-r--r-- | libxsde/xsde/cxx/parser/map.cxx | 8 | ||||
-rw-r--r-- | libxsde/xsde/cxx/parser/map.hxx | 1 | ||||
-rw-r--r-- | libxsde/xsde/cxx/parser/map.ixx | 2 |
3 files changed, 10 insertions, 1 deletions
diff --git a/libxsde/xsde/cxx/parser/map.cxx b/libxsde/xsde/cxx/parser/map.cxx index b21c41e..1382c8d 100644 --- a/libxsde/xsde/cxx/parser/map.cxx +++ b/libxsde/xsde/cxx/parser/map.cxx @@ -23,12 +23,20 @@ namespace xsde void parser_map_impl:: reset () const { + if (resetting_) + return; + + bool& r = const_cast<bool&> (resetting_); + r = true; + for (hashmap::const_iterator i (map_.begin ()), e (map_.end ()); i != e; ++i) { parser_base* p = *static_cast<parser_base* const*> (*i); p->_reset (); } + + r = false; } } } diff --git a/libxsde/xsde/cxx/parser/map.hxx b/libxsde/xsde/cxx/parser/map.hxx index 400de27..0a5c99c 100644 --- a/libxsde/xsde/cxx/parser/map.hxx +++ b/libxsde/xsde/cxx/parser/map.hxx @@ -77,6 +77,7 @@ namespace xsde private: hashmap map_; + bool resetting_; }; } } diff --git a/libxsde/xsde/cxx/parser/map.ixx b/libxsde/xsde/cxx/parser/map.ixx index 3a1f931..0f5e477 100644 --- a/libxsde/xsde/cxx/parser/map.ixx +++ b/libxsde/xsde/cxx/parser/map.ixx @@ -19,7 +19,7 @@ namespace xsde inline parser_map_impl:: parser_map_impl (size_t buckets) - : map_ (buckets, sizeof (parser_base*)) + : map_ (buckets, sizeof (parser_base*)), resetting_ (false) { } |