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

Removing an eventListener from HTTPService does not stop the listener from being called.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • Adobe Flex SDK 3.5 (Release)
    • None
    • RPC: HTTPService
    • None
    • Affected OS(s): Windows
      Affected OS(s):
      Browser: Internet Explorer 7.x
      Language Found: English

    Description

      Steps to reproduce:

      The issue appears to be related to the eventListener being added to the variable "operation" within the overridden addEventListener function in HTTPService. However there is no override for removeEventListener and the listener is never removed from "operation".

      See attached Flex Project, It should contain an application mxml file, an xml called TestFile.xml in the root directory and a class called ModifiedHTTPService.as in the customClass directory. The app should be compiling against SDK 3.5, but has also been tested again 3.4.1, 3.4.0, 3.2 and 4.0

      Once you get the app running, follow these steps.
      1. Click "display AbstractOperation state" button, this should display "false" in the label, this is showing that the AbstractOperation variable in HTTPService has not listener for ResultEvent.RESULT currently.

      2. click "add and run eventListener1" button, this should display an alert.

      3. click "display AbstractOperation state" button again and it should now show true.

      4. click "clear all listeners" button to remove all eventlisteners and then click "display AbstractOperation state" button again which will still display true.

      5. click "add and run eventListener2" button now and you will see 2 alerts one for the first eventListener and another for the second.

      Actual Results:
      the variable "operations : AbstractOperation" is getting an eventListener added to it in HTTPService, but not removed in removeEventListener. And the eventListener for both events added are being fired when Result event is dispatched.

      Expected Results:
      operations variable should have the eventListener removed on it when it's removed from the HTTPService. And only the second eventListener should catch the Result event since the listener was removed from the first.

      Workaround (if any):

      If you remove the comment block around the code in ModifiedHTTPService.as, located inside the included project. Then run the application again, you will see that removing all listeners properly removes the event listeners from the operation variable which also stops the 2 alerts from being displayed when you click the second button.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: