Close file stream

This commit is contained in:
M66B 2023-12-12 20:08:57 +01:00
parent 8d706ab258
commit cbcc467408
1 changed files with 3 additions and 1 deletions

View File

@ -574,7 +574,9 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
if (is == null)
throw new FileNotFoundException(uri.toString());
Helper.copy(is, new FileOutputStream(file));
try (FileOutputStream fos = new FileOutputStream(file)) {
Helper.copy(is, fos);
}
return FileProviderEx.getUri(this, BuildConfig.APPLICATION_ID, file);
} catch (Throwable ex) {