2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-26 06:42:27 +00:00

Better support for rvalue from-python conversions of shared_ptr:

always return a pointer that holds the owning python object *unless*
the python object contains a NULL shared_ptr holder of the right type.


[SVN r28947]
This commit is contained in:
Dave Abrahams
2005-05-16 03:31:13 +00:00
parent adb7b62a62
commit 82563df3bf
13 changed files with 186 additions and 26 deletions

View File

@@ -407,7 +407,7 @@ namespace objects
}
BOOST_PYTHON_DECL void*
find_instance_impl(PyObject* inst, type_info type)
find_instance_impl(PyObject* inst, type_info type, bool null_shared_ptr_only)
{
if (inst->ob_type->ob_type != &class_metatype_object)
return 0;
@@ -416,7 +416,7 @@ namespace objects
for (instance_holder* match = self->objects; match != 0; match = match->next())
{
void* const found = match->holds(type);
void* const found = match->holds(type, null_shared_ptr_only);
if (found)
return found;
}