Posts Tagged ‘nativewindow close’

Making sure your air application exits (?:when using ApplicationUpdater(?:UI)?)?

December 30, 2010 Leave a comment

One of our desktop applications had the requirement of providing an auto-update feature. We turned to the built in framework of ApplicationUpdaterUI to fill that requirement, but interestingly enough the form would sometimes not show at all after calling initialize and then our application wouldn’t actually exit when the main window was closed by the user and no other windows were visible.

The symptom of the application not exiting was because I was listening for the INITALIZED and ERROR events on the application updater with weak references and no other references to the updater existed. Thus, sometimes, the updater UI wouldn’t show up at all. Despite the form not showing up sometimes, the native window was actually created, so when the main window closed, the application didn’t actually exit and had to be shut down via the OS (e.g. task manager/force quit) – ouch.

Once I realized what was going on and added strong referenced listeners, I could still make the problem occur by simply closing the application updater UI dialog or by pressing the cancel button – stupid.

Read more…