Add Python support for std::unique_ptr inputs
Equivalent to Java/C# implementation.
This commit is contained in:
parent
c737bd5713
commit
c3c061cac8
8 changed files with 103 additions and 9 deletions
|
|
@ -1357,12 +1357,19 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
|
|||
}
|
||||
}
|
||||
if (sobj) {
|
||||
if (own)
|
||||
*own = *own | sobj->own;
|
||||
if (flags & SWIG_POINTER_DISOWN) {
|
||||
sobj->own = 0;
|
||||
if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !sobj->own) {
|
||||
res = SWIG_ERROR_RELEASE_NOT_OWNED;
|
||||
} else {
|
||||
if (own)
|
||||
*own = *own | sobj->own;
|
||||
if (flags & SWIG_POINTER_DISOWN) {
|
||||
sobj->own = 0;
|
||||
}
|
||||
if (flags & SWIG_POINTER_CLEAR) {
|
||||
sobj->ptr = 0;
|
||||
}
|
||||
res = SWIG_OK;
|
||||
}
|
||||
res = SWIG_OK;
|
||||
} else {
|
||||
if (implicit_conv) {
|
||||
SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue