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
This commit is contained in:
William S Fulton 2009-09-07 06:17:40 +00:00
commit 719cfe68bf
2 changed files with 2 additions and 2 deletions

View file

@ -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;
}