Basically I have some game objects that I'm using in a custom editor. It's a camera that points to a game objects and a render texture so that you can edit the definition for our NPCs and then have a preview of this object in the editor (using the render texture). We really want to keep this pattern because it helps our artists a lot to be able to see the changes they make to the item (equipment, etc). Making a bunch of prefabs for these NPCs isn't exactly an option for our data set and workflow.
Right now we have it set up such that when you close this custom editor the preview camera and object get removed from the scene. The problem is that if you have our custom editor open and then you save the scene you're currently editing, these game objects can begin to stat polluting the scene.
Right now we're semi-working-around-it by making the preview game objects destroy themselves on start, but ideally we could find a way to either 1) hook into the default "save scene" call to run custom code to check for these objects and delete them, 2) somehow otherwise ensure that these game objects don't get saved to the scene, or 3) use some other mechanism for rendering game objects to a texture for our editor other than putting a preview version of them in the current scene.