Index: boost/enable_shared_from_this.hpp =================================================================== --- boost/enable_shared_from_this.hpp (revision 44730) +++ boost/enable_shared_from_this.hpp (working copy) @@ -29,8 +29,7 @@ { if( !owned() && _internal_shared_count.empty() ) { - T * p = dynamic_cast(const_cast(this)); - detail::shared_count( p, detail::sp_deleter_wrapper() ).swap(_internal_shared_count); + detail::shared_count( (void*)0, detail::sp_deleter_wrapper() ).swap(_internal_shared_count); _internal_weak_count = _internal_shared_count; } }