[C++-sig] differencein memory management
dave at boostpro.com
Thu Jul 17 17:56:52 CEST 2008
on Thu Jul 17 2008, Gennadiy Rozental <rogeeff-AT-gmail.com> wrote:
> David Abrahams <dave <at> boostpro.com> writes:
>> > class_<A,shared_ptr<A>,...
>> > class_<A,intrusive_ptr<A>,...
>> > class_<A,A*,...
>> The first two are identical. The third one leaks a C++ A when the
>> corresponding Python A loses its last reference.
> I guess I need the later - I want to manage C++ object lifecycle myself. But in
> this case I can't get from A* back to the python object, right?
Not unless you add some machinery to do so explicitly.
More information about the Cplusplus-sig