Skip to content

Commit 7719291

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents d548598 + 0762e5d commit 7719291

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Sources/TRCache.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,13 +291,15 @@ extension TRCache {
291291
///
292292
/// - Parameter task:
293293
public func removeTmpFile(_ task: TRDownloadTask) {
294+
objc_sync_enter(self)
294295
ioQueue.async {
295296
if task.fileName.isEmpty { return }
296297
let path = (self.downloadTmpPath as NSString).appendingPathComponent(task.fileName)
297298
if self.fileManager.fileExists(atPath: path) {
298299
try? self.fileManager.removeItem(atPath: path)
299300
}
300301
}
302+
objc_sync_exit(self)
301303
}
302304
}
303305

0 commit comments

Comments
 (0)