Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-20048

ResourceManagerImpl dispatches ResourceEvent.ERROR too many times

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Adobe Flex SDK 3.4 (Release)
    • None
    • i18n : Bundle Support
    • None
    • Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Language Found: English

    Description

      Steps to reproduce:
      1. Call this.resourceManager.loadResourceModule() in a UIComponent (or use ResourceManager.getInstance() outside a UIComponent).
      2. Add an event listener to the returned IEventDispatcher for ResourceEvent.ERROR.
      3. In the listener function, remove the listener for ResourceEvent.ERROR.

      Actual Results:
      The event listener is called once, the event listener is removed, then ResourceManagerImpl handles the event again, but there isn't a listener anymore so it throws an Error instead.

      Expected Results:
      The listener will be called and no runtime error will happen.

      Workaround (if any):
      Remove the listener when it is called and add a second one (with a weak reference so that the dispatcher can get garbage collected if it isn't called after a fix is made to this bug) that does nothing except remove itself.

      More complete explanation:

      Here's where you can see the problem in the code (mx.resources.ResourceManagerImpl in Flex 4):

      Line 404: ResourceManagerImpl has a local function that gets the moduleInfo's ModuleEvent.ERROR. It dispatches ResourceEvent.ERROR for the local ResourceEventDispatcher if the event willTrigger().

      Line 1064: The private class ResourceEventDispatcher listens to ResourceEvent.ERROR too, and it dispatches the SAME event as ResourceManagerImpl.

      One of these dispatched events needs to be removed.

      Attachments

        Activity

          People

            Unassigned Unassigned
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: