From 88f7504e8109ad8f4516e404f3e40ddf81b6335d Mon Sep 17 00:00:00 2001 From: Federico Fissore Date: Tue, 15 Oct 2013 17:05:45 +0200 Subject: [PATCH] Removed destructor from File.cpp and SD.h as it leads to unexpected close/destructed objects #814 --- build/shared/revisions.txt | 1 + libraries/SD/src/File.cpp | 5 ----- libraries/SD/src/SD.h | 1 - 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/build/shared/revisions.txt b/build/shared/revisions.txt index e8fcecf57..32a2758c7 100644 --- a/build/shared/revisions.txt +++ b/build/shared/revisions.txt @@ -19,6 +19,7 @@ ARDUINO 1.5.5 BETA * avr: Fixed wrong extended fuses on Arduino Yún when using external programmer * avr: Added yun variant with LED_BUILTIN definition * avr: Refactored Mega* variants definitions in boards.txt (Kristian Sloth Lauszus) +* avr: Removed File object destructor. In order to free memory allocated by a File object the safest way is to call its close() method ARDUINO 1.5.4 BETA 2013.09.10 diff --git a/libraries/SD/src/File.cpp b/libraries/SD/src/File.cpp index c3021d6b9..6eee39aa1 100644 --- a/libraries/SD/src/File.cpp +++ b/libraries/SD/src/File.cpp @@ -43,11 +43,6 @@ File::File(void) { //Serial.print("Created empty file object"); } -File::~File(void) { - close(); - // Serial.print("Deleted file object"); -} - // returns a pointer to the file name char *File::name(void) { return _name; diff --git a/libraries/SD/src/SD.h b/libraries/SD/src/SD.h index f21ec0f29..7435cf577 100644 --- a/libraries/SD/src/SD.h +++ b/libraries/SD/src/SD.h @@ -31,7 +31,6 @@ class File : public Stream { public: File(SdFile f, const char *name); // wraps an underlying SdFile File(void); // 'empty' constructor - ~File(void); // destructor virtual size_t write(uint8_t); virtual size_t write(const uint8_t *buf, size_t size); virtual int read();