diff --git a/src/converter/builtin_converters.cpp b/src/converter/builtin_converters.cpp index 038d0ff5..96c8b2c5 100644 --- a/src/converter/builtin_converters.cpp +++ b/src/converter/builtin_converters.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include @@ -50,14 +50,14 @@ namespace return slot && *slot ? slot : 0; } - static void construct(PyObject* obj, rvalue_stage1_data* data) + static void construct(PyObject* obj, rvalue_from_python_stage1_data* data) { // Get the (intermediate) source object unaryfunc creator = *static_cast(data->convertible); handle<> intermediate(creator(obj)); // Get the location in which to construct - void* storage = ((rvalue_base_data*)data)->storage.bytes; + void* storage = ((rvalue_from_python_storage*)data)->storage.bytes; new (storage) T(SlotPolicy::extract(intermediate.get())); // record successful construction diff --git a/src/converter/callback.cpp b/src/converter/callback.cpp index e07b4869..bf72e9e6 100644 --- a/src/converter/callback.cpp +++ b/src/converter/callback.cpp @@ -17,7 +17,7 @@ namespace detail namespace { - inline PyObject* convert(void const volatile* source, to_python_function_t converter) + inline PyObject* convert_to_python(void const volatile* source, to_python_function_t converter) { if (converter == 0) { @@ -36,14 +36,14 @@ namespace detail arg_to_python_base::arg_to_python_base( void const volatile* source, to_python_function_t converter) # if !defined(BOOST_MSVC) || _MSC_FULL_VER != 13102140 - : handle<>(convert(source, converter)) + : handle<>(convert_to_python(source, converter)) # else - : m_ptr(convert(source, converter)) + : m_ptr(convert_to_python(source, converter)) # endif { } - BOOST_PYTHON_DECL void throw_if_not_registered(rvalue_stage1_data const& data) + BOOST_PYTHON_DECL void throw_if_not_registered(rvalue_from_python_stage1_data const& data) { if (!data.convertible) { @@ -108,7 +108,7 @@ namespace detail throw_error_already_set(); } - BOOST_PYTHON_DECL void* convert_rvalue(PyObject* src, rvalue_stage1_data& data, void* storage) + BOOST_PYTHON_DECL void* convert_rvalue(PyObject* src, rvalue_from_python_stage1_data& data, void* storage) { handle<> holder(src); @@ -126,6 +126,11 @@ namespace detail return data.convertible; } + + BOOST_PYTHON_DECL void absorb_result(PyObject* o) + { + Py_DECREF(expect_non_null(o)); + } } }}} // namespace boost::python::converter diff --git a/src/converter/from_python.cpp b/src/converter/from_python.cpp index 805902a5..826f453c 100644 --- a/src/converter/from_python.cpp +++ b/src/converter/from_python.cpp @@ -6,17 +6,19 @@ #include #include -#include +#include +#include +#include #include #include namespace boost { namespace python { namespace converter { -BOOST_PYTHON_DECL rvalue_stage1_data find( +BOOST_PYTHON_DECL rvalue_from_python_stage1_data find( PyObject* source , rvalue_from_python_registration const* chain) { - rvalue_stage1_data data; + rvalue_from_python_stage1_data data; data.convertible = 0; for (;chain != 0; chain = chain->next) {