To second GrumbleBunny’s solution, AddToRoot()
/ RemoveFromRoot()
work well for background threads, so long as you ensure everything is removed from rootset at some point, as MarkPendingKill()
(called on all objects on end play) has a check(!IsRooted())
.
I do the latter via a custom ASyncTask on GameThread based off of TGraphTask
's template (I used FNiagaraAudioPlayerAsyncTask
for reference), so that I can ensure RemoveFromRoot()
is called from the ASyncTask’s destructor