bdk-blender/source/blender/windowmanager
Bastien Montagne 88dcc0b176 WM: Fix invalid memory access in wmTimer handling code.
Timer management code often loops over the list of timers, calling
independant callbacks that end up freeing other timers in the list. That
would result in potentail access-after-free errors, as reported in #105160.

The typical identified scenario is wmTimer calling wmJob code, which
calls some of the job's callbacks (`update` or `end` e.g.), which call
`WM_report`, which removes and add another timer.

To address this issue on a general level, the deletion of timers is now
deferred, with the public API `WM_event_remove_timer` only marking the
timer for deletion, and the private new function
`wm_window_delete_removed_timers` effectively removing and deleting all
marked timers.

This implements design task #105369.

Pull Request #105380
2023-03-16 14:31:14 +01:00
..
gizmo Cleanup: spelling in comments 2022-08-17 15:43:17 +10:00
intern WM: Fix invalid memory access in wmTimer handling code. 2023-03-16 14:31:14 +01:00
message_bus Cleanup: Move RNA path functions into own C++ file 2022-08-04 16:13:00 +02:00
xr Cleanup: spelling in comments 2022-07-06 15:28:54 +10:00
CMakeLists.txt Cleanup: Move wm_dragdrop.c to C++ 2022-07-26 23:15:33 -05:00
WM_api.h WM: Fix invalid memory access in wmTimer handling code. 2023-03-16 14:31:14 +01:00
wm_cursors.h File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
wm_draw.h Cleanup: ensure space after file named in headers 2022-04-04 13:34:42 +10:00
wm_event_system.h File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
wm_event_types.h Cleanup: add ISMOUSE_MOTION macro 2022-07-21 16:23:33 +10:00
wm_files.h File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
WM_keymap.h Cleanup: use event parameters for functions that create key-map items 2022-04-04 14:32:42 +10:00
WM_message.h File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
wm_surface.h File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
WM_toolsystem.h WM: suppress assertion when switching tools 2022-05-06 17:44:32 +10:00
WM_types.h WM: Fix invalid memory access in wmTimer handling code. 2023-03-16 14:31:14 +01:00
wm_window.h WM: Fix invalid memory access in wmTimer handling code. 2023-03-16 14:31:14 +01:00
wm.h Cleanup: ensure space after file named in headers 2022-04-04 13:34:42 +10:00