From ee4eb695119bce96515b330f9fc83ddd67da5c62 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 2 Dec 2009 12:26:05 +0200 Subject: Implement de-registering polymorphic type information This is required for DLL/shared library unloading. --- libxsd/xsd/cxx/tree/stream-extraction-map.txx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'libxsd/xsd/cxx/tree/stream-extraction-map.txx') diff --git a/libxsd/xsd/cxx/tree/stream-extraction-map.txx b/libxsd/xsd/cxx/tree/stream-extraction-map.txx index 5534da6..ca0a44e 100644 --- a/libxsd/xsd/cxx/tree/stream-extraction-map.txx +++ b/libxsd/xsd/cxx/tree/stream-extraction-map.txx @@ -226,6 +226,13 @@ namespace xsd } template + void stream_extraction_map:: + unregister_type (const qualified_name& name) + { + type_map_.erase (name); + } + + template std::auto_ptr stream_extraction_map:: extract (istream& s, flags f, container* c) { @@ -285,10 +292,19 @@ namespace xsd template stream_extraction_initializer:: stream_extraction_initializer (const C* name, const C* ns) + : name_ (name), ns_ (ns) { stream_extraction_map_instance ().register_type ( xml::qualified_name (name, ns), &extractor_impl); } + + template + stream_extraction_initializer:: + ~stream_extraction_initializer () + { + stream_extraction_map_instance ().unregister_type ( + xml::qualified_name (name_, ns_)); + } } } } -- cgit v1.1