mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-05 14:02:48 +00:00
Remove pooled items on error
This commit is contained in:
parent
17e68f4c27
commit
85c564ad70
@ -163,9 +163,19 @@ private final class FetchVideoLibraryMediaResourceContextImpl {
|
||||
queue.async {
|
||||
item?.next(value)
|
||||
}
|
||||
}, error: { [weak item] value in
|
||||
}, error: { [weak self, weak item] value in
|
||||
queue.async {
|
||||
item?.error(value)
|
||||
guard let strongSelf = self, let item = item else {
|
||||
return
|
||||
}
|
||||
for i in 0 ..< strongSelf.items.count {
|
||||
if strongSelf.items[i] === item {
|
||||
strongSelf.items.remove(at: i)
|
||||
item.error(value)
|
||||
strongSelf.update()
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}, completed: { [weak self, weak item] in
|
||||
queue.async {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user