Fix the memory leak related to Python 3 unicode and char * conversion.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11160 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
359c4f786d
commit
a863d31e81
6 changed files with 67 additions and 10 deletions
|
|
@ -80,9 +80,11 @@ swig_varlink_str(swig_varlinkobject *v) {
|
|||
|
||||
SWIGINTERN int
|
||||
swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) {
|
||||
char *tmp;
|
||||
PyObject *str = swig_varlink_str(v);
|
||||
fprintf(fp,"Swig global variables ");
|
||||
fprintf(fp,"%s\n", SWIG_Python_str_AsChar(str));
|
||||
fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str));
|
||||
SWIG_Python_str_DelForPy3(tmp);
|
||||
Py_DECREF(str);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue