memory leak fixed

This commit is contained in:
Sebastien
2020-02-24 16:14:17 -05:00
parent e3ea0c8140
commit e19c9e12dc
11 changed files with 92 additions and 88 deletions

View File

@@ -28,7 +28,8 @@
#include "platform_esp32.h"
#include "config.h"
#include "esp_sleep.h"
#include "driver/uart.h" // for the uart driver access
#include "driver/uart.h"
#include "messaging.h"
#ifdef CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS
#define WITH_TASKS_INFO 1
@@ -130,7 +131,7 @@ esp_err_t guided_boot(esp_partition_subtype_t partition_subtype)
if(it == NULL){
ESP_LOGE(TAG,"Unable initialize partition iterator!");
set_status_message(ERROR, "Reboot failed. Cannot iterate through partitions");
messaging_post_message(MESSAGING_ERROR,MESSAGING_CLASS_SYSTEM,"Reboot failed. Cannot iterate through partitions");
}
else
{
@@ -144,18 +145,19 @@ esp_err_t guided_boot(esp_partition_subtype_t partition_subtype)
if(err!=ESP_OK){
ESP_LOGE(TAG,"Unable to set partition as active for next boot. %s",esp_err_to_name(err));
bFound=false;
set_status_message(ERROR, "Unable to select partition for reboot.");
messaging_post_message(MESSAGING_ERROR,MESSAGING_CLASS_SYSTEM,"Unable to select partition for reboot.");
}
else{
ESP_LOGW(TAG, "Application partition %s sub type %u is selected for boot", partition->label,partition_subtype);
bFound=true;
set_status_message(WARNING, "Rebooting!");
messaging_post_message(MESSAGING_WARNING,MESSAGING_CLASS_SYSTEM,"Reboot failed. Cannot iterate through partitions");
}
}
else
{
ESP_LOGE(TAG,"partition type %u not found! Unable to reboot to recovery.",partition_subtype);
set_status_message(ERROR, "Partition not found.");
messaging_post_message(MESSAGING_ERROR,MESSAGING_CLASS_SYSTEM,"partition type %u not found! Unable to reboot to recovery.",partition_subtype);
}
ESP_LOGD(TAG, "Yielding to other processes");
taskYIELD();