"Cleaning up leaked objects in scene"

Every so often, I see this show up in the console in the editor… What does this mean exactly? How does it apply my project?

This message generally appears if you are modifying assets that are not actually part of your scene hierarchy, but instead real assets in your project folder, or when temporary assets get instantiated during play mode, which are no longer attached to actual GameObjects. This can happen for example by assigning to or mordifying MeshFilter.sharedMesh or Renderer.sharedMaterial.

When modifying objects at runtime, you usually want to use MeshFilter.mesh and Renderer.material instead, which only modify the object instances, not the project assets.

I think this can happen both in play mode and with Editor script.