From 3435aeccdb6283cd5885fe620a1a59fc0f01a481 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 28 Sep 2026 14:53:48 +0530 Subject: [PATCH] Fix #10567 --- glfw/cocoa_init.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/glfw/cocoa_init.m b/glfw/cocoa_init.m index 33ad1cffd..fe1cfc55b 100644 --- a/glfw/cocoa_init.m +++ b/glfw/cocoa_init.m @@ -1134,8 +1134,9 @@ schedule_timer(Timer *t) { repeats:(t->repeats ? YES : NO)block:^(NSTimer *os_timer) { for (size_t i = 0; i < num_timers; i++) { if (timers[i].os_timer == os_timer) { - timers[i].callback(timers[i].id, timers[i].callback_data); - if (!timers[i].repeats) remove_timer_at(i); + const Timer timer = timers[i]; + timer.callback(timer.id, timer.callback_data); + if (!timer.repeats) _glfwPlatformRemoveTimer(timer.id); break; } }