Skip to content

Commit aefc656

Browse files
committed
AE-593: Fixes bugs introduced with previous commits.
1 parent 2907ec0 commit aefc656

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/InternalStorage.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ Folder InternalStorage::getRootFolder(){
9595

9696
bool InternalStorage::format(FileSystems fs){
9797
FileSystemType * tmpFileSystem = nullptr;
98+
this -> begin();
9899
this -> unmount();
99100
this -> fileSystemType = fs;
100101

src/Partitioning.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,20 +180,20 @@ std::vector<Partition> Partitioning::readPartitions(BlockDeviceType * blockDevic
180180
fatProbeFileSystem -> unmount();
181181
partition.fileSystemType = FS_FAT;
182182
partitions.push_back(partition);
183-
183+
delete mbrBlocKDevice;
184+
delete fatProbeFileSystem;
184185
} else if (littleFsProbeFilesystem -> mount(mbrBlocKDevice) == 0){
185186
Arduino_UnifiedStorage::debugPrint("[Partitioning][readPartitions][INFO] Partition " + String(partitionIndex) + " is formatted with LittleFS file system");
186187
littleFsProbeFilesystem -> unmount();
187188
partition.fileSystemType = FS_LITTLEFS;
188189
partitions.push_back(partition);
190+
delete mbrBlocKDevice;
191+
delete littleFsProbeFilesystem;
189192
} else {
190193
Arduino_UnifiedStorage::debugPrint("[Partitioning][readPartitions][INFO] Partition " + String(partitionIndex) + " is not formatted with a recognized file system");
191194
}
192195
}
193196

194-
delete mbrBlocKDevice;
195-
delete fatProbeFileSystem;
196-
delete littleFsProbeFilesystem;
197197
}
198198
blockDevice->deinit();
199199
delete[] buffer;

0 commit comments

Comments
 (0)