mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 12:14:32 +02:00
system_api: call shutdown handlers in reverse order
Similar to how destructors should be called in reverse order to the constructors.
This commit is contained in:
@@ -230,8 +230,7 @@ void esp_restart_noos(void) __attribute__ ((noreturn));
|
|||||||
|
|
||||||
void IRAM_ATTR esp_restart(void)
|
void IRAM_ATTR esp_restart(void)
|
||||||
{
|
{
|
||||||
int i;
|
for (int i = SHUTDOWN_HANDLERS_NO - 1; i >= 0; i--) {
|
||||||
for (i = 0; i < SHUTDOWN_HANDLERS_NO; i++) {
|
|
||||||
if (shutdown_handlers[i]) {
|
if (shutdown_handlers[i]) {
|
||||||
shutdown_handlers[i]();
|
shutdown_handlers[i]();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user