more typemaps unification and fixes for valgrind

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7684 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-10-19 10:52:50 +00:00
commit aadff06f45
26 changed files with 484 additions and 74 deletions

View file

@ -26,6 +26,7 @@ SWIG_AsWCharPtrAndSize(PyObject *obj, wchar_t **cptr, size_t *psize, int *alloc)
int len = PyUnicode_GetSize(obj);
if (cptr) {
*cptr = SWIG_new_array(len + 1, wchar_t);
memset(*cptr, 0, (len + 1)*sizeof(wchar_t));
PyUnicode_AsWideChar((PyUnicodeObject *)obj, *cptr, len);
(*cptr)[len] = 0;
}