[C++-sig] Instance ownership transfer in constructor.

2012-07-05 Thread Jani Tiainen
ipt stops runnning it causes crash due the fact that I've data objects are automatically destroyed by Owner-class but Python deletes them by using Data-class destructor (which shouldn't happen ever). -- Jani Tiainen - Well planned is half done and

Re: [C++-sig] Instance ownership transfer in constructor.

2012-07-05 Thread Jani Tiainen
x27;t worked for me. On Thu, Jul 5, 2012 at 7:00 PM, John Reid wrote: > On 05/07/12 11:49, Jani Tiainen wrote: > > Hi, > > > > I'm new to python.boost library and I'm trying to use it to wrap a third > > party library. Everything else I've managed to get worki

Re: [C++-sig] Instance ownership transfer in constructor.

2012-07-05 Thread Jani Tiainen
ase that `shared_ptr` are made for, Holger On Thu, Jul 5, 2012 at 6:47 PM, Jani Tiainen wrote: I want to do it another way around: Instance of Owner should hold reference to data_1 and data_2 as long as owner is alive. Now following happens: owner = Owner() data_1 = Data(owner) # data_1 owners

Re: [C++-sig] Instance ownership transfer in constructor.

2012-07-06 Thread Jani Tiainen
to work) py::with_custodian_and_ward_postcall< 2, 1 >() This should bind the lifetime of `self` to its first argument. I just never tried if this is a legal thing to do in the constructor. -Holger On Fri, Jul 6, 2012 at 8:20 AM, Jani Tiainen wrote: Hi, I'm still strugling with this whole thing