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 leakage in python bindings #4290

Merged
merged 1 commit into from
Mar 14, 2014

Commits on Feb 28, 2014

  1. Fix memory leakage in python bindings

    The python bindings generated by the groovy code generator contain a reference counting bug which results in a memory leak whenever a std::vector is converted to a python list.  The following member functions are affected:
    
    * xbmcvfs.listdir
    * xbmc.Player.getAvailableSubtitleStreams
    * xbmc.Player.getAvailableAudioStreams
    * xbmcgui.Control.getPosition
    * xbmcgui.Dialog.browse
    * xbmcgui.Dialog.browseMultiple
    
    The reference counting bug occurs because PyList_Append() increments the reference count of the item, so the caller needs to call Py_DECREF() because it no longer owns the object.
    
    This bug is especially problematic when running the Watchdog Service Addon since it may result in frequent calls to xbmcvfs.listdir, and each call can leak many kilobytes of data when listing directories containing many files.
    Daniel Burr committed Feb 28, 2014
    Configuration menu
    Copy the full SHA
    f164b7c View commit details
    Browse the repository at this point in the history