Преглед на файлове

1.修复下载中暂停或全部走通可能导致闪退问题

huangxiaodong преди 1 година
родител
ревизия
51745b5947
променени са 1 файла, в които са добавени 10 реда и са изтрити 7 реда
  1. 10 7
      创维盒子/双子星云手机/Class/Set/uploadFile/customDownloadManager/customDownloadManager.m

+ 10 - 7
创维盒子/双子星云手机/Class/Set/uploadFile/customDownloadManager/customDownloadManager.m

@@ -224,15 +224,13 @@
             [operationDoing.dataTask cancel];
         }
         
-        operationDoing.dataTask = nil;
-        operationDoing.session = nil;
-        [operationDoing.handle closeFile];
-        operationDoing.handle = nil;
-        
-        [self.downloadingOperationArr removeObject:operationDoing];
-        
+//        operationDoing.dataTask = nil;
+//        operationDoing.session = nil;
+//        [operationDoing.handle closeFile];
+//        operationDoing.handle = nil;
     }
 
+    [self.downloadingOperationArr removeAllObjects];
 }
 
 
@@ -375,6 +373,11 @@ totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend {
         return;
     }
     
+    //手动取消任务
+    if (operation.isManualCancel) {
+        return;
+    }
+    
     // 获得已经下载的文件大小
     operation.currentSize += data.length;
     HLog(@"%@\n currentSize:%lld---progress:%.2f",operation.url, operation.currentSize, 1.00*operation.currentSize/operation.totalSize);