Add Javascript support for std::unique_ptr and std::auto_ptr

Equivalent to Ruby/Python implementations.
This commit is contained in:
William S Fulton 2022-08-03 20:19:38 +01:00
commit fe17296eb4
11 changed files with 358 additions and 6 deletions

View file

@ -135,8 +135,15 @@ SWIGRUNTIME int SWIG_JSC_ConvertInstancePtr(JSContextRef context, JSObjectRef ob
}
}
if (flags & SWIG_POINTER_DISOWN) {
cdata->swigCMemOwn = false;
if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !cdata->swigCMemOwn) {
return SWIG_ERROR_RELEASE_NOT_OWNED;
} else {
if (flags & SWIG_POINTER_DISOWN) {
cdata->swigCMemOwn = false;
}
if (flags & SWIG_POINTER_CLEAR) {
cdata->swigCObject = 0;
}
}
return SWIG_OK;