When temporary File() objects are created, the programmer is not able to call close(). That made the SD library leak memory. To fix it properly, not only must we supply a destructor calling close(), but we must also not use a pointer to a SdFile, because the pointer gets copied to other objects (e.g. on a call to open()), and when this temporary object gets destructed, the buffer of the newly created object gets freed. This pull request fixes this issue.
When temporary File() objects are created, the programmer is not able to call close(). That made the SD library leak memory. To fix it properly, not only must we supply a destructor calling close(), but we must also not use a pointer to a SdFile, because the pointer gets copied to other objects (e.g. on a call to open()), and when this temporary object gets destructed, the buffer of the newly created object gets freed. This pull request fixes this issue.