Index: inkscape_py_wrap.cpp =================================================================== --- inkscape_py_wrap.cpp (revision 13631) +++ inkscape_py_wrap.cpp (working copy) @@ -54,6 +54,7 @@ ************************************************************************/ #include +#include #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) # if !defined(STATIC_LINKED) @@ -802,7 +803,7 @@ obj = pyobj; if (PyCFunction_Check(obj)) { /* here we get the method pointer for callbacks */ - char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); + char *doc = g_strdup((((PyCFunctionObject *)obj) -> m_ml -> ml_doc)); c = doc ? strstr(doc, "swig_ptr: ") : 0; if (c) { c += 10; @@ -812,6 +813,8 @@ goto type_check; } } + if(doc) + free(doc); } } if (flags & SWIG_POINTER_EXCEPTION) { @@ -977,7 +980,7 @@ swig_type_info **types_initial) { int i; for (i = 0; methods[i].ml_name; ++i) { - char *c = methods[i].ml_doc; + char *c = g_strdup(methods[i].ml_doc); if (c && (c = strstr(c, "swig_ptr: "))) { int j; swig_const_info *ci = 0; @@ -1005,7 +1008,10 @@ methods[i].ml_doc = ndoc; } } + if(!c) + free(c); } + } @@ -1405,4 +1411,3 @@ SWIG_InstallConstants(d,swig_const_table); } -