Fix #109770: WM: Memory leak of timers for file browser report #109603

Closed
Iliya Katushenock wants to merge 3 commits from mod_moder:tmp_fix_mem_leak into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
1 changed files with 1 additions and 0 deletions

View File

@ -606,6 +606,7 @@ void wm_close_and_free(bContext *C, wmWindowManager *wm)
WM_drag_free_list(&wm->drags);
wm_reports_free(wm);
BLI_freelistN(&wm->timers);
Review

Timers can themselves have allocated data, this should be replaced by a function which frees timer custom data (see: WM_TIMER_NO_FREE_CUSTOM_DATA).

Suggest adding WM_event_timer_free_data(...) which WM_event_remove_timer can call too.

Timers can themselves have allocated data, this should be replaced by a function which frees timer custom data (see: `WM_TIMER_NO_FREE_CUSTOM_DATA`). Suggest adding `WM_event_timer_free_data(...)` which `WM_event_remove_timer` can call too.
if (wm->undo_stack) {
BKE_undosys_stack_destroy(wm->undo_stack);