mirror of
				https://github.com/espressif/esp-idf.git
				synced 2025-10-30 20:51:41 +00:00 
			
		
		
		
	ESP32: Fix memory leak in controller deinit function
Added change to dealloc s_pm_lock in controller deinit as it gets allocated during init procedure. Closes https://github.com/espressif/esp-idf/issues/7653
This commit is contained in:
		| @@ -1520,9 +1520,18 @@ esp_err_t esp_bt_controller_deinit(void) | |||||||
|         esp_pm_lock_delete(s_light_sleep_pm_lock); |         esp_pm_lock_delete(s_light_sleep_pm_lock); | ||||||
|         s_light_sleep_pm_lock = NULL; |         s_light_sleep_pm_lock = NULL; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     if (s_pm_lock != NULL) { | ||||||
|  |         esp_pm_lock_delete(s_pm_lock); | ||||||
|  |         s_pm_lock = NULL; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     if (s_btdm_slp_tmr != NULL) { | ||||||
|         esp_timer_stop(s_btdm_slp_tmr); |         esp_timer_stop(s_btdm_slp_tmr); | ||||||
|         esp_timer_delete(s_btdm_slp_tmr); |         esp_timer_delete(s_btdm_slp_tmr); | ||||||
|         s_btdm_slp_tmr = NULL; |         s_btdm_slp_tmr = NULL; | ||||||
|  |     } | ||||||
|  |  | ||||||
|     s_pm_lock_acquired = false; |     s_pm_lock_acquired = false; | ||||||
| #endif | #endif | ||||||
|     semphr_delete_wrapper(s_wakeup_req_sem); |     semphr_delete_wrapper(s_wakeup_req_sem); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Rahul Tank
					Rahul Tank