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-insertion-map.txx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libxsd/xsd/cxx/tree/stream-insertion-map.txx') diff --git a/libxsd/xsd/cxx/tree/stream-insertion-map.txx b/libxsd/xsd/cxx/tree/stream-insertion-map.txx index c3cf9b5..f9d5745 100644 --- a/libxsd/xsd/cxx/tree/stream-insertion-map.txx +++ b/libxsd/xsd/cxx/tree/stream-insertion-map.txx @@ -256,6 +256,13 @@ namespace xsd template void stream_insertion_map:: + unregister_type (const type_id& tid) + { + type_map_.erase (&tid); + } + + template + void stream_insertion_map:: insert (ostream& s, const type& x) { if (const type_info* ti = find (typeid (x))) @@ -320,6 +327,14 @@ namespace xsd xml::qualified_name (name, ns), &inserter_impl); } + + template + stream_insertion_initializer:: + ~stream_insertion_initializer (const C* name, const C* ns) + { + stream_insertion_map_instance ().unregister_type ( + typeid (T)); + } } } } -- cgit v1.1