i have a memory leak issue with extension function that im working on. it reads data from a binary file into a stl vector then creates a new list to pass back to the python interface. the function works the first 1021 times but then gives a segmentation fault (core dumped). heres the business part of the code:
//read data vector<float> data; float temp; for(int x=0;x<np*2;x++) { fread(&temp,sizeof(float),1,datfil); data.push_back(temp); } //convert vector to list PyObject *newlist = PyList_New(np*2); PyList_SetItem(newlist, 0,PyFloat_FromDouble(data[0])); for(int x=0;x<np*2;x++) { PyList_SetItem(newlist, x,PyFloat_FromDouble(data[x])); } //send back list return newlist; thanks for any advice
-- http://mail.python.org/mailman/listinfo/python-list