Move the destruction of global resources, being used by multiple documents, to the editor.
Do not destroy overlay if it was never created (e.g. due to an Ogre exception).