simpler warning for mem leak, due to problem reported by Mike Romberg
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8730 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
9db5576a18
commit
24404e25aa
1 changed files with 2 additions and 6 deletions
|
|
@ -424,12 +424,8 @@ PySwigObject_dealloc(PyObject *v)
|
|||
Py_XDECREF(res);
|
||||
} else {
|
||||
const char *name = SWIG_TypePrettyName(ty);
|
||||
#if (PY_VERSION_HEX >= 0x02020000)
|
||||
PyObject *wrn = PyString_FromFormat("swig/python detected a memory leak of type '%s'.", name);
|
||||
PyErr_Warn(PyExc_RuntimeWarning, PyString_AsString(wrn));
|
||||
Py_DECREF(wrn);
|
||||
#else
|
||||
printf("swig/python detected a memory leak of type '%s'.", name);
|
||||
#if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
|
||||
printf("swig/python detected a memory leak of type '%s', no destructor found.\n", name);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue