Test w/ NULL pointer to enabled_... object added; bug fixed.

[SVN r16402]
This commit is contained in:
Peter Dimov
2002-11-25 12:17:56 +00:00
parent 1311731e24
commit 9632464c45
2 changed files with 9 additions and 1 deletions

View File

@ -66,9 +66,12 @@ void test()
BOOST_TEST(py.use_count() == 3);
}
void test2();
int main()
{
test();
test2();
return boost::report_errors();
}
@ -102,3 +105,8 @@ boost::shared_ptr<Y> createY()
boost::shared_ptr<Y> pi(new impl2);
return pi;
}
void test2()
{
boost::shared_ptr<Y> pi(static_cast<impl2*>(0));
}

View File

@ -72,7 +72,7 @@ template<> struct shared_ptr_traits<void const>
template<class T, class Y> void sp_enable_shared_from_this(boost::enable_shared_from_this<T> * pe, Y * px, shared_count const & pn)
{
pe->_internal_weak_this._internal_assign(px, pn);
if(pe != 0) pe->_internal_weak_this._internal_assign(px, pn);
}
inline void sp_enable_shared_from_this(void const *, void const *, shared_count const &)