 		initContextMenu();
 		if (!topLevel)
 		{
+            // We are not top-level and don't have a parent. This can happen
+            // when the application has already been unloaded by the time
+            // we get to this point.
+            if (!parent)
+                return;
+
 			var obj:DisplayObjectContainer = parent.parent;
 
   			// if there is no grandparent at this point, we might have been removed and

	 */
	public function removeChildBridge(bridge:IEventDispatcher):void
	{
        var fm:IFocusManager = IFocusManager(bridgeToFocusManager[bridge]);
        fm.removeSWFBridge(bridge);
        swfBridgeGroup.removeChildBridge(bridge);

import mx.core.Window;
import mx.core.mx_internal;
import mx.events.FlexEvent;
import mx.events.FlexChangeEvent;
import mx.events.EventListenerRequest;
import mx.events.InvalidateRequestData;
import mx.events.InterManagerRequest;
