diff --git a/include/boost/python/converter/shared_ptr_from_python.hpp b/include/boost/python/converter/shared_ptr_from_python.hpp index 1535740a..5b7d5441 100644 --- a/include/boost/python/converter/shared_ptr_from_python.hpp +++ b/include/boost/python/converter/shared_ptr_from_python.hpp @@ -19,7 +19,6 @@ struct shared_ptr_from_python converter::registry::insert(&convertible, &construct, type_id >()); } - static shared_ptr_from_python const registration; private: static void* convertible(PyObject* p) { @@ -45,9 +44,6 @@ struct shared_ptr_from_python } }; -template -shared_ptr_from_python const shared_ptr_from_python::registration; - }}} // namespace boost::python::converter #endif // SHARED_PTR_FROM_PYTHON_DWA20021130_HPP diff --git a/include/boost/python/object/class_converters.hpp b/include/boost/python/object/class_converters.hpp index b9cf4a43..a891c994 100644 --- a/include/boost/python/object/class_converters.hpp +++ b/include/boost/python/object/class_converters.hpp @@ -18,6 +18,8 @@ # include +# include + namespace boost { namespace python { namespace objects { ////////////////////////////////////////////////////////////////////// @@ -76,8 +78,9 @@ struct register_base_of template inline void register_class_from_python(Derived* = 0, Bases* = 0) { - python::detail::force_instantiate(converter::shared_ptr_from_python::registration); - + // Static object constructor performs registration + static converter::shared_ptr_from_python shared_ptr_registration; + // register all up/downcasts here register_dynamic_id();