fix: Close f_open handle if background image found
This commit is contained in:
@@ -305,6 +305,7 @@ void ThemeFile::applyBackground()
|
||||
FRESULT result = f_open(&file, rootDir.c_str(), FA_OPEN_EXISTING);
|
||||
if (result == FR_OK) {
|
||||
instance->setBackgroundImageFileName((char *)rootDir.c_str());
|
||||
f_close(&file);
|
||||
} else {
|
||||
// TODO: This needs to be made user configurable, not
|
||||
// require the file be deleted to remove global background
|
||||
@@ -315,6 +316,7 @@ void ThemeFile::applyBackground()
|
||||
result = f_open(&file, fileName, FA_OPEN_EXISTING);
|
||||
if (result == FR_OK) {
|
||||
instance->setBackgroundImageFileName(fileName);
|
||||
f_close(&file);
|
||||
} else {
|
||||
instance->setBackgroundImageFileName("");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user