Skip navigation
Currently Being Moderated

Air application not closing correctly

Mar 3, 2009 8:18 AM

Hello,

I'm working on an AIR project for a client and I'm having a problem: some testers reported that after closing the application they can still see the application running in the task manager using about 50% of the cpu.

From what we where able to see, this problem is present only in Windows XP SP2. If the same application is run on XP SP3 or Mac the application exits as expected.

If the application is opened again, a new instance of the application is visible in the task manager. After closing it both the instances remain in the task manager.

We noticed also that this behavior happens only after the application starts loading data from a web server using a URLLoader. (so far the problem was reported if the application was closed after the request but before the reply of the server, but we are still looking into this)

We tried calling the Close method of the URLLoader before shutting down the application or calling explicitly the NativeApplication.nativeApplication.exit(), but this doesn't affect the outcome.

Can someone suggest a way for us to troubleshoot this?

Thank you very much
Andrea
 
Replies
  • Currently Being Moderated
    Mar 3, 2009 1:12 PM   in reply to Andrea Rincon Ray
    Could you file a bug at:
    http://www.adobe.com/go/wish/
    ?
    It would be very helpful if you can include a simple program that shows the problem.

    Thanks,

    ted
     
    |
    Mark as:
  • Currently Being Moderated
    Mar 4, 2009 10:29 AM   in reply to tzeng
    I notice this in my own application quite often. After exiting, it sometimes takes upwards of 2 minutes before the system try icon will go away and its process is terminated. This even happens in ADL. Another weird thing with this is that sometimes just rolling the mouse over the system tray icon will remove it and terminate the process.
     
    |
    Mark as:
  • Currently Being Moderated
    Mar 5, 2009 9:49 AM   in reply to Andrea Rincon Ray
    Thanks for filing the bug.

    The AIR bug database could not be seen from outside, not like the Flex bug database.

    I will post here if I find out it is accepted or rejected.

    -ted
     
    |
    Mark as:
  • Currently Being Moderated
    Jun 1, 2009 10:49 AM   in reply to tzeng

    Were there any further developments on this bug report? I am having the same issues, only from what I see it's also on XP Service Pack 3, and haven't really found any solutions.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 1, 2009 4:29 PM   in reply to Andrea Rincon Ray

    I found out an another way to trigger this bug that does not terminate program correctly. Here a way to reproduce the bug:

     

    Start an AIR application, let it load.

    Go to your taskbar on the bottom of the screen and find you AIR application there.

    Right click on that AIR application

    Click Close

     

    Open up your task manager and go to Processes

    After you closed it as mentioned above, your AIR program is actually still running in the process list even tho it got closed. It should have been terminated but it never did due this bug.

     

    I tested this bug on Window XP service pack 2 and Window Vista Service Pack 1. Both are affected.  I have not be able to test this on Mac OS X.

     

    If you trigger this bug, your program wont be able to rerun again unless you reboot your computer or log off/log back in.

     

    I have not report this bug yet.

     

    No solution yet except tell the user not to right click -> close as mentioned above...

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 1, 2009 6:26 PM   in reply to rjs23

    I can't reproduce this problem.

     

    -ted

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 1, 2009 7:59 PM   in reply to tzeng

    What operating system are you running?  In Window Vista service pack 2, it

    doesn’t reproduce the bug anymore... Maybe same for XP service pack 3...The

    test was based on Ajax made applications.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 2, 2009 9:56 AM   in reply to rjs23

    I tried a SWF AIR app. on Vista.

     

    I will take a look at a AJAX app.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 17, 2009 12:55 PM   in reply to Andrea Rincon Ray

    Use the following code to close the application properly.

     

     

            public function applicationExit():void
            {
                var exitingEvent:Event = new Event(Event.EXITING, false, true);
                NativeApplication.nativeApplication.dispatchEvent(exitingEvent);
                if (!exitingEvent.isDefaultPrevented()) {
                    NativeApplication.nativeApplication.exit();
                }
            }

     

     

    call this funciton by using the close event in <mx:WindowedApplication close="applicationExit()">

     


    More details about this can be found here: http://help.adobe.com/en_US/AIR/1.1/devappshtml/WS5b3ccc516d4fbf351e63 e3d118676a5d46-8000.html

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 17, 2011 7:48 AM   in reply to Andrea Rincon Ray

    Hi there, i had such problem too and the code given by coolkams didnt work for me.

    Here is what i did :

    First thing i want to know the the main app is activated:

     

    NativeApplication.nativeApplication.addEventListener(Event.ACTIVATE, onAppactivation);

     

    Then the callback function add a CLOSE event listener to the current active window wich is the main application window:

     

    private function onAppactivation(e:Event):void

    {

        NativeApplication.nativeApplication.removeEventListener(Event.ACTIVAT E, onAppactivation);

        NativeApplication.nativeApplication.activeWindow.addEventListener(Eve nt.CLOSE, applicationExit);

    }

     

     

    Finnaly in the CLOSE event callback function :

    private function applicationExit(e:Event):void

    {

        e.currentTarget.removeEventListener(Event.CLOSE, applicationExit);

         NativeApplication.nativeApplication.exit();

    }

     

    That did the trick for me, hope it will help other people too...

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 7, 2013 3:59 AM   in reply to tzeng

    Hi All,

     

    Any updates on this ? i am facing same issue in Windows XP SP3 but this issue is not coming Windows 7 and 8, windows Server, MAC OS.

     

     

    Please let me know if you have solution of this issue

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points