mirror of
https://github.com/boostorg/smart_ptr.git
synced 2025-08-02 06:04:27 +02:00
Test w/ NULL pointer to enabled_... object added; bug fixed.
[SVN r16402]
This commit is contained in:
@@ -66,9 +66,12 @@ void test()
|
|||||||
BOOST_TEST(py.use_count() == 3);
|
BOOST_TEST(py.use_count() == 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void test2();
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
test();
|
test();
|
||||||
|
test2();
|
||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,3 +105,8 @@ boost::shared_ptr<Y> createY()
|
|||||||
boost::shared_ptr<Y> pi(new impl2);
|
boost::shared_ptr<Y> pi(new impl2);
|
||||||
return pi;
|
return pi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void test2()
|
||||||
|
{
|
||||||
|
boost::shared_ptr<Y> pi(static_cast<impl2*>(0));
|
||||||
|
}
|
||||||
|
@@ -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)
|
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 &)
|
inline void sp_enable_shared_from_this(void const *, void const *, shared_count const &)
|
||||||
|
Reference in New Issue
Block a user