From c8beb4e9bcd11dcec30fe7abe7a626834498f928 Mon Sep 17 00:00:00 2001 From: jhengazuki Date: Sun, 26 Oct 2025 19:28:39 +0800 Subject: [PATCH] Fix bug --- .../main/java/com/xunlei/downloadlib/XLTaskHelper.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/thunder/src/main/java/com/xunlei/downloadlib/XLTaskHelper.java b/thunder/src/main/java/com/xunlei/downloadlib/XLTaskHelper.java index a0aa5b7ea..24031f088 100644 --- a/thunder/src/main/java/com/xunlei/downloadlib/XLTaskHelper.java +++ b/thunder/src/main/java/com/xunlei/downloadlib/XLTaskHelper.java @@ -135,9 +135,9 @@ public class XLTaskHelper { stopTask(taskId); } - private synchronized void deleteFile(File dir) { - if (dir.isDirectory()) for (File file : Path.list(dir)) deleteFile(file); - if (!dir.getAbsolutePath().endsWith(".torrent")) dir.delete(); + private synchronized void deleteFile(File file) { + if (file.isDirectory()) for (File f : Path.list(file)) deleteFile(f); + if (file.isFile() && !file.getAbsolutePath().endsWith(".torrent")) Path.clear(file); } public synchronized void stopTask(GetTaskId taskId) { @@ -160,6 +160,8 @@ public class XLTaskHelper { public synchronized void release() { if (manager != null) manager.release(); + Path.clear(Path.files("setting.cfg")); + Path.clear(Path.files("seq_id")); manager = null; seq = null; }