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

Andreas Beyer beyer at imb-jena.de
Thu Apr 14 18:16:12 CEST 2005


My platform is
  Python 2.4.1 (#1, Apr  8 2005, 15:53:09)
  gcc (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-20)
  boost cvs download from Apr. 5th

The program runs single-threaded. There is nothing else as what I gave 
in my example. I didn't even use Idle for the python part, but just a 
plain python shell.

Can someone else try to reproduce this behavior on another Linux platform?
David, are there other ways to obtain a weak pointer from a python object?

Thanks!
    Andreas

Peter Dimov wrote:

>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? 
>
>
>
>_______________________________________________
>C++-sig mailing list
>C++-sig at python.org
>http://mail.python.org/mailman/listinfo/c++-sig
>
>  
>




More information about the Cplusplus-sig mailing list