Skip to content
This repository has been archived by the owner on Aug 22, 2022. It is now read-only.

修复stopUpload函数中,在me.pool遍历时删除数组元素导致遍历不全的问题 #3095

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Jim-Rae
Copy link

@Jim-Rae Jim-Rae commented Feb 20, 2020

$.each( me.pool, function( _, v ) {
// 只 abort 指定的文件,每一个分片。
if (v.file === file) {
v.transport && v.transport.abort();
if (interrupt) {
me._putback(v);
me._popBlock(v);
}
}
});

此处用$.each遍历me.pool时,me._popBlock(v);会删除me.pool里的元素,导致遍历不全,对分片回收不完整,从而出现暂停后再上传时,上传分片不全的问题。

本人引入变量 e 对其进行校正,解决此问题,望采纳!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant