StaticMesh garbage collection issue

You need to put the pointer into a container.

Check this doc