Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory leak in C extensions #419

Merged
merged 1 commit into from
Aug 27, 2018

Commits on Aug 27, 2018

  1. BUG: Fix memory leak in C extensions

    Since C functionality is implemented for the calculation of the angles, texture matrix calculation returns a tuple of the matrix and the angles.
    However, this uses Py_BuildValue with specifier "O", which increases the reference count, and thereby introduces a memory leak.
    
    Fix this by replacing "O" by "N", which has the same effect for the returned values, but does not increase the reference count.
    
    Moreover, the angles array is only needed for GLCM and GLRLM matrices. Therefore, only return the angles array in these 2 functions and free the array in the other functions.
    JoostJM committed Aug 27, 2018
    Configuration menu
    Copy the full SHA
    ce20248 View commit details
    Browse the repository at this point in the history