mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-04-20 23:22:07 +00:00
Release file lock by closing InputStream
Fix issue where backup file remained locked by closing InputStream after use
This commit is contained in:
parent
2b8625bf0e
commit
a5168a6a2b
1 changed files with 5 additions and 3 deletions
|
|
@ -62,6 +62,8 @@ void doRestore(Ref ref, {required String path, required BuildContext context}) {
|
|||
}
|
||||
} catch (e, s) {
|
||||
botToast('$e\n$s');
|
||||
} finally {
|
||||
inputStream.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -379,9 +381,9 @@ void restoreKotatsuBackup(Ref ref, Archive archive) {
|
|||
|
||||
@riverpod
|
||||
void restoreTachiBkBackup(Ref ref, String path, BackupType bkType) {
|
||||
final content = GZipDecoder().decodeBytes(
|
||||
InputFileStream(path).toUint8List(),
|
||||
);
|
||||
final inputStream = InputFileStream(path);
|
||||
final content = GZipDecoder().decodeBytes(inputStream.toUint8List());
|
||||
inputStream.close();
|
||||
final backup = BackupMihon.fromBuffer(content);
|
||||
List<Category> cats = [];
|
||||
isar.writeTxnSync(() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue