pilluli/service.xbmc.callbacks — pull request #2 by anaconda (2014-06-17 01:11:45+00:00)
Title: Fix memory leak and script timeout.

Hello,
this pull request fixes a couple issues when XBMC gets stopped:
* timeout:
```
ERROR: CPythonInvoker(3, /home/xbian/.xbmc/addons/service.xbmc.callbacks-0.5/default.py): script didn't stop in 5 seconds - let's kill it
```
Scripts get killed after 5 seconds if they didn't stop gracefully already, so I changed the sleep from 10 seconds to 4 (safer than 5 or something near 5);

* a memory leak when it gets uninitialized:
```
02:46:24 33069.355469 T:2904552512 WARNING: CPythonInvoker(3, /home/xbian/.xbmc/addons/service.xbmc.callbacks-0.5/default.py): the python script "/home/xbian/.xbmc/addons/service.xbmc.callbacks-0.5/default.py" has left several classes in memory that we couldn't clean up. The classes include: N14PythonBindings31XBMCAddon_xbmc_Monitor_DirectorE,N14PythonBindings30XBMCAddon_xbmc_Player_DirectorE
```

I added a comment in the code explaining why this happens, and removed the unnecessary `del` statements.