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/std-ostream-map.txx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libxsd/xsd/cxx/tree/std-ostream-map.txx') diff --git a/libxsd/xsd/cxx/tree/std-ostream-map.txx b/libxsd/xsd/cxx/tree/std-ostream-map.txx index c1187ef..ee46f16 100644 --- a/libxsd/xsd/cxx/tree/std-ostream-map.txx +++ b/libxsd/xsd/cxx/tree/std-ostream-map.txx @@ -219,6 +219,13 @@ namespace xsd template void std_ostream_map:: + unregister_type (const type_id& tid) + { + type_map_.erase (&tid); + } + + template + void std_ostream_map:: insert (std::ostream& os, const type& x) { if (inserter i = find (typeid (x))) @@ -274,6 +281,13 @@ namespace xsd std_ostream_map_instance ().register_type ( typeid (T), &inserter_impl); } + + template + std_ostream_initializer:: + ~std_ostream_initializer () + { + std_ostream_map_instance ().unregister_type (typeid (T)); + } } } } -- cgit v1.1