[C++-sig] Memory management in Boost.Python
Ernie Lee
tr.ernie.l at gmail.com
Wed Mar 11 04:24:08 CET 2015
Hi Stefan,
I updated my code so it now use 'boost::shared_ptr' class while
specifying the held-type and i got exactly the same errors (i guess boost
did recognize class even in different namespace).
Any other theories of what could be wrong? Could it be that Python in
some cases tries to manage memory directly, disregarding SP layer?
Thanks,
Ernie.
On Tue, Mar 10, 2015 at 3:55 PM, Ernie Lee <tr.ernie.l at gmail.com> wrote:
> Thank you for looking this up Stefan! It turned out that we actually
> using boost::shared_ptr but in rather non-straight-forward way: it got pull
> in to our own namespace so in the end Boost::Python::class_ is 'called'
> with held-type set to a formally different type name. I will see if setting
> held-type to boost::shared_ptr fix this.
>
> Best,
>
> Ernie.
>
>
> On Tue, Mar 10, 2015 at 9:17 AM, Stefan Seefeld <stefan at seefeld.name>
> wrote:
>
>> Ernie,
>>
>> it appears what you are seeing is the fact that boost.python only
>> supports boost::shared_ptr, but not std::shared_ptr. (See
>> https://svn.boost.org/trac/boost/ticket/6545). Is it possible for you to
>> switch to Boost's shared_ptr, at least for the Python bindings ? Yes, we
>> need to fix this urgently... :-(
>>
>> Stefan
>>
>>
>> --
>>
>> ...ich hab' noch einen Koffer in Berlin...
>>
>> _______________________________________________
>> Cplusplus-sig mailing list
>> Cplusplus-sig at python.org
>> https://mail.python.org/mailman/listinfo/cplusplus-sig
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20150310/91da7d6c/attachment.html>
More information about the Cplusplus-sig
mailing list