OSDN Git Service

CMFileManager: when cancel coping, the dest file also exists and is incomplete.
[android-x86/packages-apps-CMFileManager.git] / src / com / cyanogenmod / filemanager / util / FileHelper.java
index 0cf98fe..ea031ed 100644 (file)
@@ -1198,6 +1198,11 @@ public final class FileHelper {
                     bos.close();
                 }
             } catch (Throwable e) {/**NON BLOCK**/}
+            if (program.isCancelled()) {
+                if (!dst.delete()) {
+                    Log.e(TAG, "Failed to delete the dest file: " + dst);
+                }
+            }
         }
     }