Skip to content

Commit c9e836a

Browse files
committed
G7710 and Infineat : close the files after having verified that they exist.
1 parent eb0af22 commit c9e836a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/displayapp/screens/WatchFaceCasioStyleG7710.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,13 +340,16 @@ bool WatchFaceCasioStyleG7710::IsAvailable(Pinetime::Controllers::FS& filesystem
340340
return false;
341341
}
342342

343+
filesystem.FileClose(&file);
343344
if (filesystem.FileOpen(&file, "/fonts/7segments_40.bin", LFS_O_RDONLY) < 0) {
344345
return false;
345346
}
346347

348+
filesystem.FileClose(&file);
347349
if (filesystem.FileOpen(&file, "/fonts/7segments_115.bin", LFS_O_RDONLY) < 0) {
348350
return false;
349351
}
350352

353+
filesystem.FileClose(&file);
351354
return true;
352355
}

src/displayapp/screens/WatchFaceInfineat.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,13 +617,16 @@ bool WatchFaceInfineat::IsAvailable(Pinetime::Controllers::FS& filesystem) {
617617
return false;
618618
}
619619

620+
filesystem.FileClose(&file);
620621
if (filesystem.FileOpen(&file, "/fonts/bebas.bin", LFS_O_RDONLY) < 0) {
621622
return false;
622623
}
623624

625+
filesystem.FileClose(&file);
624626
if (filesystem.FileOpen(&file, "/images/pine_small.bin", LFS_O_RDONLY) < 0) {
625627
return false;
626628
}
627629

630+
filesystem.FileClose(&file);
628631
return true;
629632
}

0 commit comments

Comments
 (0)