From c9e836a02eda005758d3c1b047ad5ed25498f816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Milants?= Date: Sat, 15 Oct 2022 16:52:55 +0200 Subject: [PATCH] G7710 and Infineat : close the files after having verified that they exist. --- src/displayapp/screens/WatchFaceCasioStyleG7710.cpp | 3 +++ src/displayapp/screens/WatchFaceInfineat.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/displayapp/screens/WatchFaceCasioStyleG7710.cpp b/src/displayapp/screens/WatchFaceCasioStyleG7710.cpp index 525c2eeb..bdae0d42 100644 --- a/src/displayapp/screens/WatchFaceCasioStyleG7710.cpp +++ b/src/displayapp/screens/WatchFaceCasioStyleG7710.cpp @@ -340,13 +340,16 @@ bool WatchFaceCasioStyleG7710::IsAvailable(Pinetime::Controllers::FS& filesystem return false; } + filesystem.FileClose(&file); if (filesystem.FileOpen(&file, "/fonts/7segments_40.bin", LFS_O_RDONLY) < 0) { return false; } + filesystem.FileClose(&file); if (filesystem.FileOpen(&file, "/fonts/7segments_115.bin", LFS_O_RDONLY) < 0) { return false; } + filesystem.FileClose(&file); return true; } diff --git a/src/displayapp/screens/WatchFaceInfineat.cpp b/src/displayapp/screens/WatchFaceInfineat.cpp index 01b425da..bd4e4ac8 100644 --- a/src/displayapp/screens/WatchFaceInfineat.cpp +++ b/src/displayapp/screens/WatchFaceInfineat.cpp @@ -617,13 +617,16 @@ bool WatchFaceInfineat::IsAvailable(Pinetime::Controllers::FS& filesystem) { return false; } + filesystem.FileClose(&file); if (filesystem.FileOpen(&file, "/fonts/bebas.bin", LFS_O_RDONLY) < 0) { return false; } + filesystem.FileClose(&file); if (filesystem.FileOpen(&file, "/images/pine_small.bin", LFS_O_RDONLY) < 0) { return false; } + filesystem.FileClose(&file); return true; }