Hugh Macdonald wrote: > PyMethodDef *callbackFunctionDef = new PyMethodDef; > callbackFunctionDef->ml_name = "doLoadCallback"; > callbackFunctionDef->ml_meth = &myPython_doLoadCallback; > callbackFunctionDef->ml_flags = 1;
I think this gives a memory leak. I was rather thinking of static PyMethodDef doLoadCallback = { "doLoadCallback", &myPython_doLoadCallback, 1 }; PyObject *pyCallbackFunc = PyCFunction_New(&doLoadCallback, NULL); Since you have to write the C(++) functions statically, you can also provide the PyMethodDef objects statically. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list