#29 memory leak in glVertex2s

v2.0
closed-fixed
nobody
GL (74)
5
2002-12-28
2002-03-10
Anonymous
No

Hi, I installed PyOpenGL-2.0.0.44.win32-py2.2.exe.

I hunted a memleak in my app for some time and I
finally fixed it: my app lost mem everytime it called
glVertex2s.

glVertex2f and glVertex2sv are working fine though.

Discussion

  • Mike C. Fletcher

    Logged In: YES
    user_id=34901

    I'm guessing this is the responsible code from
    interface/simple_typemaps.inc (would be nice to have a
    test-case BTW to be sure it's still a problem):

    $1= ($1_type)(PyInt_AsLong( PyNumber_Int($input) ));

    Why is PyNumber_Int used, PyInt_AsLong attempts to do the
    conversion anyway, and PyNumber_Int creates a _new_
    reference (hence the leak)!

    Rene, could you check that I haven't missed something C-ish
    (or maybe some sort of weird Python-version problem?), and
    if not, simply eliminate the PyNumber_Int call?

    if (PyInt_Check($input) || PyLong_Check($input))
    {
    $1= ($1_type)(PyInt_AsLong( $input ));
    }

    PyOpenGL builds with the given change, but again, there
    isn't a test for the condition to confirm that it actually
    fixes the problem.

     
  • Mike C. Fletcher

    • assigned_to: twburton --> nobody
     
  • Mike C. Fletcher

    Logged In: YES
    user_id=34901

    Ah well, I'll assume I got it right (I accidentally ;)
    checked the change in), as it seems to work and be logical.

     
  • Mike C. Fletcher

    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks