diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2009-12-02 12:26:05 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2009-12-02 12:26:05 +0200 |
commit | ee4eb695119bce96515b330f9fc83ddd67da5c62 (patch) | |
tree | 817bf37d4b0f0fb89e785004c41b4c6928228f79 /libxsd/xsd/cxx/tree/std-ostream-map.txx | |
parent | c155e6925211747af9a13a5994c2f768c5048971 (diff) |
Implement de-registering polymorphic type information
This is required for DLL/shared library unloading.
Diffstat (limited to 'libxsd/xsd/cxx/tree/std-ostream-map.txx')
-rw-r--r-- | libxsd/xsd/cxx/tree/std-ostream-map.txx | 14 |
1 files changed, 14 insertions, 0 deletions
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 <typename C> void std_ostream_map<C>:: + unregister_type (const type_id& tid) + { + type_map_.erase (&tid); + } + + template <typename C> + void std_ostream_map<C>:: insert (std::ostream& os, const type& x) { if (inserter i = find (typeid (x))) @@ -274,6 +281,13 @@ namespace xsd std_ostream_map_instance<id, C> ().register_type ( typeid (T), &inserter_impl<T>); } + + template<unsigned long id, typename C, typename T> + std_ostream_initializer<id, C, T>:: + ~std_ostream_initializer () + { + std_ostream_map_instance<id, C> ().unregister_type (typeid (T)); + } } } } |