Re: Memory Management in Embedded Python

2007-01-18 Thread Martin v. Löwis
Huayang Xia schrieb: > I have a piece of code like this: > > void funct(PyObject* pyobj) > { > char str[128]; > strncpy(str, "just a test string", sizeof(str)); > PyObject* pydata = PyObject_CallMethod(pyobj, "method_x", > "s", str); > Py_DECREF(py

Memory Management in Embedded Python

2007-01-18 Thread Huayang Xia
Hi there, I have a piece of code like this: void funct(PyObject* pyobj) { char str[128]; strncpy(str, "just a test string", sizeof(str)); PyObject* pydata = PyObject_CallMethod(pyobj, "method_x", "s", str); Py_DECREF(pydata); } After the fu