Test/fixes to handle NULL pointer for unique_ptr/auto_ptr

Also add missing unique_ptr tests for Lua and Racket.
This commit is contained in:
William S Fulton 2022-08-31 08:35:55 +01:00
commit 7934561874
32 changed files with 434 additions and 6 deletions

View file

@ -9,7 +9,7 @@
* ----------------------------------------------------------------------------- */
%define %unique_ptr(TYPE)
%typemap(in, checkfn="lua_isuserdata", noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) {
%typemap(in, checkfn="SWIG_isptrtype", noblock=1) std::unique_ptr< TYPE > (void *argp = 0, int res = 0) {
res = SWIG_ConvertPtr(L, $input, &argp, $descriptor(TYPE *), SWIG_POINTER_RELEASE);
if (!SWIG_IsOK(res)) {
if (res == SWIG_ERROR_RELEASE_NOT_OWNED) {