Do not launch new coroutines in invokeOnCompletion()
The scope might has been cancelled
This commit is contained in:
1 parent
6b0f8bc325
commit
eb95026a47
1 file changed
+1
-3
@@ -573,9 +573,7 @@ class SpiderQueen private constructor(val galleryInfo: GalleryInfo) : CoroutineS
|
||||
invokeOnCompletion {
|
||||
if (getPageState(index) == STATE_DOWNLOADING) {
|
||||
Log.d(WORKER_DEBUG_TAG, "Download image cancelled $index")
|
||||
launchNonCancellable {
|
||||
mSpiderDen.remove(index)
|
||||
}
|
||||
mSpiderDen.remove(index)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user