Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
Adobe Flex SDK 3.4 (Release)
-
None
-
None
-
Affected OS(s): All OS Platforms
Language Found: English
Description
When closing down a native window I'm getting the following exception:
TypeError: Error #1034: Type Coercion failed: cannot convert mx.managers::DragManagerImpl@1c17bd01 to mx.managers.NativeDragManagerImpl.
at mx.managers::WindowedSystemManager/http://www.adobe.com/2006/flex/mx/internal::cleanup()[C:\autobuild\3.x\frameworks\projects\airframework\src\mx\managers\WindowedSystemManager.as:4232]
at flash.display::NativeMenuItem/select()
at flash.display::NativeMenuItem/performKeyEquivalent()
at flash.display::NativeMenu/_menuItemPerformKeyEquivalent()
at flash.display::NativeMenu/performKeyEquivalent()
at flash.display::NativeMenuItem/_menuPerformKeyEquivalent()
at flash.display::NativeMenuItem/performKeyEquivalent()
at flash.display::NativeMenu/_menuItemPerformKeyEquivalent()
at flash.display::NativeMenu/performKeyEquivalent()
at flash.desktop::NativeApplication/_menuPerformKeyEquivalent()
at flash.desktop::NativeApplication/_onKeyDownCapture()
Looking at the code the first check should not be trying to cast to an object type it's then attempting to compare it's type. Perhaps use "as" then check for null to know whether or not you have a NativeDragManager or not.
/**
- @private
- Cleans up references to Window. Also removes self from topLevelSystemManagers list.
*/
mx_internal function cleanup(e:Event):void { if (NativeDragManagerImpl(Singleton.getClass("mx.managers::IDragManager").getInstance()) is NativeDragManagerImpl) NativeDragManagerImpl(Singleton.getClass("mx.managers::IDragManager").getInstance()).unregisterSystemManager(this); SystemManagerGlobals.topLevelSystemManagers.splice(SystemManagerGlobals.topLevelSystemManagers.indexOf(this), 1); myWindow.removeEventListener("close", cleanup); myWindow = null; }