From fdfc9150dd6f17c881f64003d2be0ed65a5e2d52 Mon Sep 17 00:00:00 2001 From: Nic Barker Date: Mon, 13 Apr 2026 11:26:26 +1000 Subject: [PATCH] [Core] Fix a crash when removing a transition handler mid transition --- clay.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clay.h b/clay.h index 797682b..f376a08 100644 --- a/clay.h +++ b/clay.h @@ -4507,8 +4507,9 @@ Clay_RenderCommandArray Clay_EndLayout(float deltaTime) { continue; } } - // Transition element exited and doesn't have an exit handler defined, delete the transition data - } else if (hashMapItem->generation <= context->generation) { + // Transition element exited and doesn't have an exit handler defined + // Or, the user deleted the transition handler from one frame to the next + } else if (hashMapItem->generation <= context->generation || !hashMapItem->layoutElement->config.transition.handler) { Clay__TransitionDataInternalArray_RemoveSwapback(&context->transitionDatas, i); i--; continue;