diff --git a/src/entsoe/EntsoeApi.cpp b/src/entsoe/EntsoeApi.cpp index 8f89afaa..886e7201 100644 --- a/src/entsoe/EntsoeApi.cpp +++ b/src/entsoe/EntsoeApi.cpp @@ -27,7 +27,10 @@ void EntsoeApi::setup(EntsoeConfig& config) { this->config = new EntsoeConfig(); } memcpy(this->config, &config, sizeof(config)); - lastCurrencyFetch = 0; + lastTodayFetch = lastTomorrowFetch = lastCurrencyFetch = 0; + if(today != NULL) delete today; + if(tomorrow != NULL) delete tomorrow; + today = tomorrow = NULL; } char* EntsoeApi::getToken() {