Is There a way to know when the Application is in shutdown state?

I have some singleton classes like a event dispatcher. Some events get posted when GameObjects are destroyed, also when the Application shuts down. Due to the way my singleton classes work, they always create a new instance eg. event dispatcher, when posting a new event. Right now this floods the scene with dozens of singletons when quitting the app. Is there a way to avoid getting objects created which mess up the scene in the editor, when the application is already in shutdown state? Somekind of flag in the Application which tells me its shutting down?


Maybe you can do something similar to this (and use it as a base class)

static var isShuttingDown : boolean;

static function SafeInstantiate (original : Object, position : Vector3, rotation : Quaternion) : Object
    if (isShuttingDown)
        return null;    
        return Instantiate(original, position, rotation);

function OnApplicationQuit()
    isShuttingDown = true;