From 1aa5ac8be60dd97e9577dc426625a8f746378433 Mon Sep 17 00:00:00 2001 From: fabianoms Date: Sat, 28 Apr 2018 12:11:03 -0300 Subject: [PATCH] Minimizing code redundancy String's destructor does the same as the 'invalidate' method. --- cores/esp8266/WString.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cores/esp8266/WString.cpp b/cores/esp8266/WString.cpp index 6f2134e86f..c81b594d6c 100644 --- a/cores/esp8266/WString.cpp +++ b/cores/esp8266/WString.cpp @@ -113,10 +113,7 @@ String::String(double value, unsigned char decimalPlaces) { } String::~String() { - if(buffer) { - free(buffer); - } - init(); + invalidate(); } // /*********************************************/