From 719cfe68bf161cf65a529da3138d3a12a3907304 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Mon, 7 Sep 2009 06:17:40 +0000 Subject: [PATCH] add some useful info for assert around SWIG_CAST_NEW_MEMORY git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11686 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/perl5/perlrun.swg | 2 +- Lib/python/pyrun.swg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/perl5/perlrun.swg b/Lib/perl5/perlrun.swg index b506c3af9..ecb1f5cd2 100644 --- a/Lib/perl5/perlrun.swg +++ b/Lib/perl5/perlrun.swg @@ -293,7 +293,7 @@ SWIG_Perl_ConvertPtrAndOwn(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_ int newmemory = 0; *ptr = SWIG_TypeCast(tc,voidptr,&newmemory); if (newmemory == SWIG_CAST_NEW_MEMORY) { - assert(own); + assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ if (own) *own = *own | SWIG_CAST_NEW_MEMORY; } diff --git a/Lib/python/pyrun.swg b/Lib/python/pyrun.swg index 21fddb610..c0d30ee45 100644 --- a/Lib/python/pyrun.swg +++ b/Lib/python/pyrun.swg @@ -1089,7 +1089,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int int newmemory = 0; *ptr = SWIG_TypeCast(tc,vptr,&newmemory); if (newmemory == SWIG_CAST_NEW_MEMORY) { - assert(own); + assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ if (own) *own = *own | SWIG_CAST_NEW_MEMORY; }