[Core] Fix a crash when removing a transition handler mid transition

This commit is contained in:
Nic Barker 2026-04-13 11:26:26 +10:00
parent 4c2c778861
commit fdfc9150dd

5
clay.h
View file

@ -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;