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:
Marcelo Matus 2006-02-06 18:38:22 +00:00
commit 24404e25aa

View file

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