0

My XBMC AddOn produces a lot of log warnings about potential memory leaks:

13:49:02 T:139712465467136 WARNING: CPythonInvoker(12, /home/test/.xbmc/addons/script.testplugin/default.py): the python script "/home/test/.xbmc/addons/script.testplugin/default.py" has left several classes in memory that we couldn't clean up. The classes include: N14PythonBindings42XBMCAddon_xbmcgui_WindowXMLDialog_DirectorE,N9XBMCAddon7xbmcgui12ControlLabelE,N9XBMCAddon7xbmcgui12ControlLabelE,N9XBMCAddon7xbmcgui8ListItemE

What causes this warnings and how can I avoid them?

sofarsogood
  • 291
  • 2
  • 13

1 Answers1

1

Did you make and use a subclass of xbmcaddon.Addon class in your plugin code?

It looks like Kodi/XBMC may have a problem with cleaning up subclasses of xbmcaddon.Addon class. I noticed that as soon as I create an instance of such subclass, I start receiving warning messages from CPythonInvoker that are similar to yours.

sys.getrefcount(instanceOfMySubclass) gives me 4 references immediately after an instance of my subclass is created. Deleting the subclass with del apparently removes a reference to the subclass from the current scope, but it is unclear if it also removes the other 3 references. Perhaps the other references are the ones that make CPythonInvoker complain about "several classes in memory that we couldn't clean up".

In my case, as soon as I stopped using subclasses of xbmcaddon.Addon the warning messages disappeared.

Beef Eater
  • 374
  • 3
  • 8