[C++-sig] Re: shared_ptr -> weak_ptr -> shared_ptr

Peter Dimov pdimov at mmltd.net
Thu Apr 14 11:42:11 CEST 2005


David Abrahams wrote:
> Andreas Beyer <beyer at imb-jena.de> writes:
>
>> Hi.
>>
>> I would like to transform a shared pointer originating from a python
>> object to a weak pointer. Later I would like to transform it back to
>> a shared pointer. For some strange reason I keep getting seg-faults
>> when trying to lock the weak pointer.
>> Is there any danger in storing shared pointers from python objects as
>> weak pointers?
>
> Shouldn't be, especially in your case.  This behavior really surprises
> me.  Peter, do you have anything to say about this?

It should work. Is it possible that Boost.Python is single-threaded but 
ptr_test is mutlithreaded? Which platform? 






More information about the Cplusplus-sig mailing list