You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File::File used to allocate RAM what was not freed when destroying the File object.
Adding a dedicated destructor war not enough to fix. It would also need copy- and move-constructors.
Removed the File::FILE(const char* name) constructor.
Changed the File::File(void) constructor to not malloc() any RAM.
Unified and changed the SDClass::open() methods.
Removed the open method without mode parameter. Instead gave the method with a mode parameter a default mode.
Now open() has the complete control over memory allocation. When it is not able to open a file no memory in left allocated.
Advantage: A created File what was not opened or was not able to be opened has not to be closed anymore to avoid memory losses. Only a scsessfilly opened file has to be closed.
0 commit comments