stm32duino / STM32SD

Enables reading and writing on SD card using SD card slot of the STM32 Board.
157 stars 23 forks source link

File class is not RAII friendly #66

Closed willeccles closed 1 year ago

willeccles commented 1 year ago

The File class leaks memory if deleted without calling close(). A simple DTOR which handles closing the file when the object is deleted would solve this problem. This would then require handling of move-assignment and move-construction. Additionally, this class should not be copyable (simply deleting the copy constructor and copy assignment operator would solve this). If desired, I can provide a patch to do all of the above.

willeccles commented 1 year ago

Implemented in #67.

willeccles commented 1 year ago

Closing per discussion on #67.