Skip to content

Commit fb52bba

Browse files
authored
feat(SDFS): Add destructor to clean up resources
1 parent 8b470d6 commit fb52bba

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libraries/SD/src/SD.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ using namespace fs;
2222

2323
SDFS::SDFS(FSImplPtr impl) : FS(impl), _pdrv(0xFF) {}
2424

25+
SDFS::~SDFS() {
26+
end();
27+
}
28+
2529
bool SDFS::begin(uint8_t ssPin, SPIClass &spi, uint32_t frequency, const char *mountpoint, uint8_t max_files, bool format_if_empty) {
2630
if (_pdrv != 0xFF) {
2731
return true;

0 commit comments

Comments
 (0)