Thread safety issues when spawning new tick functions in Pre Physics tick group


As far as I can tell and test, the Tick Task Manager will delay execution of new tick functions spawned during Pre Physics to Start Physics, even if the tick function was registered for Pre Physics. Because the physics tick has already started in Start Physics and there is no way to know if the delayed tick function accesses the physics scene, this sounds very scary to me.

I see there is already some code in FTickFunction::QueueTickFunction() to avoid scheduling delayed tick functions in the During Physics tick group. I think this should be expanded to handle the Start and End Physics ones too. Could you guys please have a look at it? The codebase I’m working with is GitHub 4.7.3-release. Thanks!



Yeah that sounds correct to me. I will fix it today.

What seems a little odd to me though is that new ticks should end up in TG_NewlySpawned…but anyway I will check it out.