]> granicus.if.org Git - esp-idf/commit
esp_timer: fix for the case when timer is deleted in callback
authorIvan Grokhotkov <ivan@espressif.com>
Fri, 24 Nov 2017 09:33:13 +0000 (17:33 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Wed, 29 Nov 2017 03:44:46 +0000 (11:44 +0800)
commit6e7eb3c776cf68669bcc31352ca5493dfb540e6d
treea88bb0bc17136f61b209c95be4877d426cd8ee8a
parent1d5389668b7572c6baebccc50d792ec56fd44c58
esp_timer: fix for the case when timer is deleted in callback

Timer callback can delete the timer. If CONFIG_ESP_TIMER_PROFILING was
enabled, this caused an access to invalid (freed) memory.
This fix adds a pointer to track the timer while executing the callback.
This is needed so that we can check if callback deletes the timer,
in which case we won't try updating profiling counters for this timer
after the callback is done.
components/esp32/esp_timer.c
components/esp32/test/test_esp_timer.c