Merge pull request #4663 from Zahnstocher/storage_leak_fix
Storage leak download fix #4656
This commit is contained in:
commit
9ee6dd03e8
1 changed files with 5 additions and 1 deletions
|
@ -213,7 +213,11 @@ public class DownloadFileHelper {
|
||||||
}
|
}
|
||||||
unzipFile(de, progress, downloadInputStreams);
|
unzipFile(de, progress, downloadInputStreams);
|
||||||
if(!de.targetFile.getAbsolutePath().equals(de.fileToDownload.getAbsolutePath())){
|
if(!de.targetFile.getAbsolutePath().equals(de.fileToDownload.getAbsolutePath())){
|
||||||
Algorithms.removeAllFiles(de.targetFile);
|
boolean successfull = Algorithms.removeAllFiles(de.targetFile);
|
||||||
|
if (successfull) {
|
||||||
|
ctx.getResourceManager().closeFile(de.targetFile.getName());
|
||||||
|
}
|
||||||
|
|
||||||
boolean renamed = de.fileToDownload.renameTo(de.targetFile);
|
boolean renamed = de.fileToDownload.renameTo(de.targetFile);
|
||||||
if(!renamed) {
|
if(!renamed) {
|
||||||
showWarningCallback.showWarning(ctx.getString(R.string.shared_string_io_error) + ": old file can't be deleted");
|
showWarningCallback.showWarning(ctx.getString(R.string.shared_string_io_error) + ": old file can't be deleted");
|
||||||
|
|
Loading…
Reference in a new issue