diff --git a/SWIG/Lib/typemaps/ptrtypes.swg b/SWIG/Lib/typemaps/ptrtypes.swg index 6e9c6f06a..9a55d7ea3 100644 --- a/SWIG/Lib/typemaps/ptrtypes.swg +++ b/SWIG/Lib/typemaps/ptrtypes.swg @@ -53,9 +53,7 @@ int res = asptr_meth($input, &ptr); if (!SWIG_IsOK(res) || !ptr) { %variable_fail(SWIG_TypeError, "$type", "$name"); } $1 = *ptr; - if (SWIG_IsNewObj(res)) { - %delete(ptr); - } + if (SWIG_IsNewObj(res)) %delete(ptr); } %enddef