Dangling pointer + mem corruption related to OwnerLastRenderTimePtr

A good find! I’ll look into fixing this in UE very soon, we’ll most likely opt for a full renderstate update to be sure everything is tied together correctly (other things could depend on the actor).

We usually do not change this ptr while in use by the render thread and actor/component destruction uses a fence in the renderthread commands and a conditionaldestroy to make sure it’s ok to delete the object. I’ll see how I reconcile this with the fact renames cannot be delayed. We will probably need a mechanism to force the old actor to use the fence even if it has no primitive components anymore just to be 100% sure a preempeted renderthread doesn’t have this ptr value loaded in its thread state. The write of the new ptr should be atomic on most platform as is, so will be seen instantly and should work. In any case my fix will ensure all of this is ok.

So there’s still a tiny possibility of stomp with your fix even if it’s exceedingly rare. We’ll let you know when we have a CL, but in the meantime the fix is better than the original code.