#106 glReadPixels appears to be leaking memory

v2.0.1
closed-fixed
GL (74)
7
2004-10-17
2004-05-18
Joe
No

Code example as follows

# draw scene
red = glReadPixelsub(0,0, self.width, self.height,
GL_RED)

# draw different scene
pixels = glReadPixelsub(0,0, self.width, self.height,
GL_RGB)
pixels[:,:, 0] = red
pixels.shape = (self.height, self.width, 3)
glDrawPixelsub(GL_RGB, pixels)

If run for more than a minute (at full screen, 1600x1200)
resolution, this code snippet will cause Python to crash.
Watching memory allocation to this process shows that
memory held increase up until crash.

Tests using a similar version of the code but replacing
the above with a version using the GL accumulate buffer
does not crash.

This happens on both WinXP and Linux (Gentoo).

Discussion

  • Logged In: NO

    I've just run into this myself. I'd like to verify that
    both this memory
    leak and the campanion (wrong shape) bugs exist in the
    Version 2.0.1.07
    implementation of glReadPixels. Has there been any fixes in
    later version?

     
  • Logged In: NO

    I've just run into this myself. I'd like to verify that
    both this memory
    leak and the campanion (wrong shape) bugs exist in the
    Version 2.0.1.07
    implementation of glReadPixels. Has there been any fixes in
    later version?

     
    • status: open --> closed
     
  • Logged In: YES
    user_id=34901

    Hmm, thought I'd closed this yesterday. Leak was found and
    eliminated. The Numeric path through the _PyObjectFromArray
    method was not freeing the temporary array when "own" was
    set (all other paths do free it).

     
    • priority: 5 --> 7
    • assigned_to: nobody --> mcfletch
    • status: closed --> closed-fixed