Merge pull request #1353 from auouymous/fix-hang-when-resuming-thousands-of-episodes

Fix hang when resuming thousands of episodes.
This commit is contained in:
auouymous 2022-08-13 00:06:28 -07:00 committed by GitHub
commit bab023a4db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -193,7 +193,10 @@ class DownloadStatusModel(Gtk.ListStore):
# as only the main thread is allowed to manipulate the list store.
def get_next(self):
dqr = DequeueRequest()
util.idle_add(self.__get_next, dqr)
# this can not be idle_add because update_downloads_list() is called from a higher
# priority timeout_add and would spin forever, never calling this.
from gi.repository import GLib
GLib.timeout_add(0, self.__get_next, dqr)
return dqr.dequeue()
def _work_gen(self):