mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-04-20 10:52:05 +00:00
Merge pull request #493 from NBA2K1/main
Release file lock by closing InputStream
This commit is contained in:
commit
53c82d80dd
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