Can UStaticMesh.bAllowCPUAccess be set in C++ code on runtime?

I’m using the new mesh slice feature. I got a lot of StaticMesh which bAllowCPUAccess is not set.
After I cooked the release build, the game crashed at

MyGame!UKismetProceduralMeshLibrary::GetSectionFromStaticMesh()
MyGame!UKismetProceduralMeshLibrary::CopyProceduralMeshFromStaticMeshComponent()

I tried to set bAllowCPUAccess in code:

staticMesh->bAllowCPUAccess = true;

This line is correct in syntax, but the game still crashed at the same line.

So the question is:

Since I don’t want to set all of meshes’ bAllowCPUAccess manually (it’s boring, and I’m worry about it may slow down the game?),

is there a way to let me use CopyProceduralMeshFromStaticMeshComponent with static meshes’ bAllowCPUAccess not set before build (e.g. copy and create a new StaticMesh which bAllowCPUAccess is set when creating), or I can only set bAllowCPUAccess in Editor before build? If so, why bAllowCPUAccess is settable in code ( staticMesh->bAllowCPUAccess = true; ) ?

Thanks in advance.

Hey man, Even i am stuck at this issue.
I learned one trick recently, since i have to enable cpu access for around 1800 assets :

  1. In any blueprint call a small cpp method which just enables the cpu access for the provided mesh in runtime.
  2. Drop all your target assets (on the one you want CPU access), and you could pass these assets in a loop(or anyhow) and call the above mentioned method. This does the job in the editor and does enable the bool on those meshes.
  3. Remember to not include this method in your shipping builds/ core game logic.

If you have any better solutions please put it out here.
I tired this on 5.1.1
I even tried to add staticMesh->bAllowCPUAccess = true; in a shipping build, and it crashed!!