Opened 13 years ago
Last modified 9 years ago
#3673 assigned Feature Requests
boost python and weak_ptr from a shared_ptr argument
Reported by: | troy d. straszheim | Owned by: | troy d. straszheim |
---|---|---|---|
Milestone: | Boost 1.43.0 | Component: | python USE GITHUB |
Version: | Boost 1.41.0 | Severity: | Problem |
Keywords: | Cc: |
Description
if you save a weak_ptr of a shared_ptr passed to you by python, it expires almost immediately (see use of aliasing constructor in shared_ptr_from_python.hpp). See also mail from Jahn Fuchs on c++-sig list subject: boost python and weak_ptr from a shared_ptr argument
Attachments (2)
Change History (6)
comment:1 by , 13 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
by , 13 years ago
Attachment: | weak_ptr.cpp added |
---|
comment:2 by , 13 years ago
Milestone: | Boost 1.42.0 → Boost 1.43.0 |
---|
I provided a simple test case that demonstrates the problem. Just compile "weak_ptr.cpp", adapt the imports and run the python script, and you will get
> python testWeakPtr.py python: /home/olenz/projects/espresso++/src/trunk/contrib/boost/boost/smart_ptr/shared_ptr.hpp:409: T* boost::shared_ptr< <template-parameter-1-1> >::operator->() const [with T = A]: Assertion `px != 0' failed. Aborted
comment:3 by , 9 years ago
I confirm this bug with boost 1.49. Perhaps should be goal version updated?
comment:4 by , 9 years ago
PS for the reference a post at stackoverflow dealing with this problem: http://stackoverflow.com/questions/8233252/boostpython-and-weak-ptr-stuff-disappearing
Testcase for the problem