[C++-sig] Re: call_method and reference_existing_object results in "Attempt to return dangling pointer..."
dave at boost-consulting.com
Tue Aug 26 13:51:33 CEST 2003
"Evgeny O. Kochenyuk" <evgeny at digitalfun.ru> writes:
> Hello c++-sig,
> I've got a python class method that wraps a c++ function returning
> class reference(as "reference_existing_object"). When using
> call_method on it this error message shown:
> Traceback (most recent call last):
> File "test_xxx.py", line 6, in ?
> ReferenceError: Attempt to return dangling reference to object of type: struct C
> Here's the code:
> (Surely a reference on object such as "static C c" can't be
It's the enclosing Python object which would be dangling. This is a
limitation of Boost.Python at the moment. Please see
More information about the Cplusplus-sig