Shut down libsync thread correctly

This commit is contained in:
tomkat83 2017-02-02 14:49:14 +01:00
parent 05247d99cb
commit 15a39f9e64

View file

@ -1432,6 +1432,9 @@ class LibrarySync(Thread):
now = getUnixTimestamp() now = getUnixTimestamp()
deleteListe = [] deleteListe = []
for i, item in enumerate(self.itemsToProcess): for i, item in enumerate(self.itemsToProcess):
if self.threadStopped():
# Chances are that Kodi gets shut down
break
if item['state'] == 9: if item['state'] == 9:
successful = self.process_deleteditems(item) successful = self.process_deleteditems(item)
elif now - item['timestamp'] < self.saftyMargin: elif now - item['timestamp'] < self.saftyMargin: