@@ -398,6 +398,7 @@ async function loadIndexPage(animation = true, path = false, content = false, ke
398
398
{
399
399
let file = fileManager . file ( masterFolders [ key ] ) ;
400
400
let files = await file . readDir ( ) ;
401
+ file . destroy ( ) ;
401
402
402
403
for ( let i = 0 , len = files . length ; i < len ; i ++ )
403
404
{
@@ -522,6 +523,7 @@ async function loadIndexPage(animation = true, path = false, content = false, ke
522
523
523
524
let file = fileManager . file ( path ) ;
524
525
let files = await loadFilesIndexPage ( file , animation , path , keepScroll , mainPath ) ;
526
+ file . destroy ( ) ;
525
527
526
528
if ( config . ignoreSingleFoldersLibrary && ! fromGoBack && ! disableIgnoreSingleFolders && files . length == 1 )
527
529
{
@@ -607,6 +609,7 @@ async function nextComic(path, mainPath)
607
609
{
608
610
let file = fileManager . file ( mainPath ) ;
609
611
let image = await file . images ( 1 , path ) ;
612
+ file . destroy ( ) ;
610
613
611
614
return image && image . path ? image . path : false ;
612
615
}
@@ -615,6 +618,7 @@ async function previousComic(path, mainPath)
615
618
{
616
619
let file = fileManager . file ( mainPath ) ;
617
620
let image = await file . images ( - 1 , path ) ;
621
+ file . destroy ( ) ;
618
622
619
623
return image && image . path ? image . path : false ;
620
624
}
@@ -742,6 +746,8 @@ async function getFolderThumbnails(path)
742
746
743
747
_images = await _getFolderThumbnails ( file , images , _images , path , folderSha ) ;
744
748
749
+ file . destroy ( ) ;
750
+
745
751
poster = _images . poster ;
746
752
images = _images . poster ? false : _images . images ;
747
753
}
@@ -754,7 +760,11 @@ async function getFolderThumbnails(path)
754
760
let file = fileManager . file ( path ) ;
755
761
let _images = await file . images ( 4 , false , true ) ;
756
762
757
- _getFolderThumbnails ( file , images , _images , path , folderSha , true ) ;
763
+ await _getFolderThumbnails ( file , images , _images , path , folderSha , true ) ;
764
+
765
+ file . destroy ( ) ;
766
+
767
+ return ;
758
768
759
769
} , path , folderSha ) ;
760
770
}
@@ -1209,6 +1219,7 @@ async function comicContextMenu(path, fromIndex = true, folder = false, gamepad
1209
1219
1210
1220
let file = fileManager . file ( path ) ;
1211
1221
let images = await file . images ( 2 , false , true ) ;
1222
+ file . destroy ( ) ;
1212
1223
1213
1224
poster = ! Array . isArray ( images ) ? images . path : false ;
1214
1225
@@ -1318,6 +1329,8 @@ async function openComic(animation = true, path = true, mainPath = true, end = f
1318
1329
}
1319
1330
}
1320
1331
1332
+ file . destroy ( ) ;
1333
+
1321
1334
skipNextComic = await nextComic ( path , mainPath ) ;
1322
1335
skipPreviousComic = await previousComic ( path , mainPath ) ;
1323
1336
@@ -1355,6 +1368,7 @@ async function openComic(animation = true, path = true, mainPath = true, end = f
1355
1368
{
1356
1369
let fileImage = fileManager . file ( file . path ) ;
1357
1370
let images = await fileImage . images ( 4 ) ;
1371
+ file . destroy ( ) ;
1358
1372
1359
1373
if ( images . length > 0 )
1360
1374
{
0 commit comments