2015-09-20, 20:50
I'm not sure if it's a bug or intended to work this way. I've discovered when switching profiles, Kodi does not return true for abortRequested() - Kodi monitor (it only does the first time, but then after it doesn't seem to).
Is there a cue we can use with the api, to know if the profile is being switched so we can cleanly terminate python code? This current issue causes threads to not terminate. The add-on is a service add-on and it's set to load with the profile:
First profile switch, everything terminates as it should:
Second profile switch, abortrequested() didn't return True, leaving threads/connections running:
Is there a cue we can use with the api, to know if the profile is being switched so we can cleanly terminate python code? This current issue causes threads to not terminate. The add-on is a service add-on and it's set to load with the profile:
Code:
<extension point="xbmc.service" library="service.py" start="login">
</extension>
First profile switch, everything terminates as it should:
Code:
12:58:22 T:4712 NOTICE: -->Python Interpreter Initialized<--
13:00:25 T:3368 NOTICE: Previous line repeats 1 times.
13:00:25 T:3368 NOTICE: Arctic Zephyr Script --> shutdown requested !
13:00:25 T:3368 NOTICE: LibraryMonitor -> stop : - stop called
13:00:25 T:3368 NOTICE: arctic zephyr helper version 1.0.9 stopped
13:00:26 T:3368 WARNING: CPythonInvoker(1, C:\Users\Corruption\AppData\Roaming\Kodi\addons\script.arctic.zephyr.helper\service.py): the python script "C:\Users\Corruption\AppData\Roaming\Kodi\addons\script.arctic.zephyr.helper\service.py" has left several classes in memory that we couldn't clean up. The classes include: class XBMCAddon::xbmcgui::Window
13:00:26 T:6320 WARNING: CPythonInvoker(4, C:\Users\Corruption\AppData\Roaming\Kodi\addons\service.skin.widgets\default.py): the python script "C:\Users\Corruption\AppData\Roaming\Kodi\addons\service.skin.widgets\default.py" has left several classes in memory that we couldn't clean up. The classes include: class XBMCAddon::xbmcgui::Window,class PythonBindings::XBMCAddon_xbmc_Player_Director,class PythonBindings::XBMCAddon_xbmc_Monitor_Director
13:00:27 T:2848 WARNING: CPythonInvoker(6, C:\Users\Corruption\AppData\Roaming\Kodi\addons\service.library.data.provider\service.py): the python script "C:\Users\Corruption\AppData\Roaming\Kodi\addons\service.library.data.provider\service.py" has left several classes in memory that we couldn't clean up. The classes include: class XBMCAddon::xbmcgui::Window,class PythonBindings::XBMCAddon_xbmc_Monitor_Director,class PythonBindings::XBMCAddon_xbmc_Player_Director
13:00:27 T:5312 NOTICE: EMBY WebSocketThread -> Stopping Client
13:00:27 T:3024 NOTICE: EMBY LibrarySync -> --- Library Sync Thread stopped ---
13:00:27 T:4896 NOTICE: EMBY WebSocketThread -> Error: tuple index out of range
13:00:27 T:5312 NOTICE: EMBY WebSocketThread -> Stopping Client : KeepRunning set to False
13:00:27 T:4896 NOTICE: EMBY WebSocketThread -> Thread Exited
13:00:27 T:5312 NOTICE: EMBY Service -> ======== STOP EMBY ========
13:00:27 T:7156 NOTICE: EMBY UserClient -> |---- UserClient Stopped ----|
13:00:27 T:5312 WARNING: CPythonInvoker(7, C:\Users\Corruption\AppData\Roaming\Kodi\addons\plugin.video.emby\service.py): the python script "C:\Users\Corruption\AppData\Roaming\Kodi\addons\plugin.video.emby\service.py" has left several classes in memory that we couldn't clean up. The classes include: class XBMCAddon::xbmcgui::Window,class XBMCAddon::xbmcgui::Window,class XBMCAddon::xbmcgui::Window,class XBMCAddon::xbmcgui::Window,class XBMCAddon::xbmcaddon::Addon,class XBMCAddon::xbmcaddon::Addon,class XBMCAddon::xbmcaddon::Addon,class XBMCAddon::xbmcaddon::Addon,class XBMCAddon::xbmcaddon::Addon,class XBMCAddon::xbmcaddon::Addon,class XBMCAddon::xbmcaddon::Addon,class XBMCAddon::xbmc::Player,class PythonBindings::XBMCAddon_xbmc_Monitor_Director,class PythonBindings::XBMCAddon_xbmc_Monitor_Director,class PythonBindings::XBMCAddon_xbmc_Monitor_Director
13:00:28 T:5464 NOTICE: script.tv.show.next.aired: ### abort requested -- stopping background processing
13:00:28 T:6336 NOTICE: ES: Stopping event server
13:00:28 T:6336 NOTICE: Webserver: Stopping...
13:00:28 T:6336 NOTICE: WebServer: Stopped the webserver
13:00:28 T:6336 NOTICE: Webserver: Stopped...
13:00:29 T:3980 NOTICE: ES: UDP Event server stopped
13:00:29 T:6336 NOTICE: special://profile/ is mapped to: special://masterprofile/profiles/Angel-Remote/
13:00:29 T:6336 NOTICE: No settings file to load (special://xbmc/system/advancedsettings.xml)
13:00:29 T:6336 NOTICE: Loaded settings file from special://masterprofile/advancedsettings.xml
13:00:29 T:6336 NOTICE: Contents of special://masterprofile/advancedsettings.xml are...
<advancedsettings>
<videolibrary>
<allitemsonbottom>true</allitemsonbottom>
</videolibrary>
<fanartres>1080</fanartres>
<imageres>1080</imageres>
</advancedsettings>
Second profile switch, abortrequested() didn't return True, leaving threads/connections running:
Code:
13:03:28 T:5424 NOTICE: EMBY WriteKodiVideoDB -> Found embyId: 98b3128a753b35efb2106c8457d91aca in database - kodiId: 388 fileId: 388 type: movie
13:03:28 T:5424 NOTICE: EMBY LibrarySync -> Sync Database, Incremental Sync Setting Last Run Time Saved: 2015-09-20T17:58:28Z
13:03:28 T:3448 NOTICE: Thread VideoInfoScanner start, auto delete: false
13:03:28 T:3448 NOTICE: VideoInfoScanner: Starting scan ..
13:03:28 T:3448 NOTICE: VideoInfoScanner: Finished scan. Scanning for video info took 00:00
13:03:28 T:5180 NOTICE: Thread BackgroundLoader start, auto delete: false
13:03:37 T:6336 NOTICE: Previous line repeats 2 times.
13:03:37 T:6336 NOTICE: ES: Stopping event server
13:03:37 T:6336 NOTICE: Webserver: Stopping...
13:03:37 T:6336 NOTICE: WebServer: Stopped the webserver
13:03:37 T:6336 NOTICE: Webserver: Stopped...
13:03:37 T:2740 NOTICE: ES: UDP Event server stopped
13:03:37 T:6336 NOTICE: special://profile/ is mapped to: special://masterprofile/
13:03:37 T:6336 NOTICE: No settings file to load (special://xbmc/system/advancedsettings.xml)
13:03:37 T:6336 NOTICE: Loaded settings file from special://profile/advancedsettings.xml
13:03:37 T:6336 NOTICE: Contents of special://profile/advancedsettings.xml are...
<advancedsettings>
<videolibrary>
<allitemsonbottom>true</allitemsonbottom>
</videolibrary>
<fanartres>1080</fanartres>
<imageres>1080</imageres>
</advancedsettings>