mvMatrix = glGetDoublev(GL_MODELVIEW_MATRIX)
This line leaks substantial amounts of memory. In my
application I had this happening on every refresh, with a
resulting leak sucking up at least 32K/sec!
Test file for the leak situation
Logged In: YES
Confirmed that this occurs with PyOpenGL 22.214.171.124 with
Python 2.2.1 on Win2K. Test file now attached.
Okay, have been looking at this, basically, there is a lot
of macro expansion going on, but at the core, we have this
( interfaceutil.inc )
#define NUMERIC_PyObject_From(NAME, BASE, TYPECODE)\
PyObject* _PyObject_From##NAME(int nd, int* dims, BASE*
data, int own)\
int i, l;\
if (own) my = data; else\
for (i = 0, l = 1; i < nd; i++) l *= dims[i];\
my = PyMem_New(BASE, l);\
memcpy(my, data, sizeof(BASE)*l);\
return PyArray_FromDimsAndData(nd, dims, TYPECODE,
return NonNumeric_PyObject_From##NAME(nd, dims, data, own);\
Now, PyArray_FromDimsAndData says that it takes static
memory that can never be released, so I'm thinking that it
doesn't free the memory pool when (PyMem_Free) when the
array object is deleted. As a result, there's a leak every
time we create a return-value array (of any type).
Not sure what we should do. Could just use PyArray_FromDims
and then manually copy the data from the source, but that
seems a little... inelegant. Suggestions?
Have just checked in a fix for this, appears to address the
problem. It uses PyArray_FromDims and then manually copies
the data from the source (as described earlier). Test no
longer leaks memory.
I have the same problem you started off with. How do I fix it?
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.