Internet Explorer doesn't let go of SWF files.. Big issue for FMS devs
So it's kind of been brought to my attention again about this issue of IE7 or 8 not letting go of SWFs when the browser is closed or the back button is clicked. So essentially the SWF should be unloaded from memory and destroyed but it stays.. I don't think this issue happens for any of those but FMS live (perhaps red5 and wowza too?) connections. So it's the socket connection that keeps IE thinking that it shouldn't let go of the SWF. I don't think it's a Flash player issue.
So how to fix it?
Well.. after a bunch of experimenting it's been established that the SWF no longer acts on it's own anymore. In other words, if it should be "doing something", it won't do it anymore. If you make a call from FMS to the client SWF that should be unloaded then it will react, but it won't do something, like call the server, on it's own.
Which leads to the workaround for this issue, which sucks really.. but has to be done for some apps that are based on paying for time online. Essentially you need to have the client side make a call to the server at a predetermined time. For example, once every 30 seconds. Then, the server receives this call and saves the call time in a variable on the client (or if you check out my tutes on fmsguru.com then you would probably be using a userManager and a users object). The application on the server side should then be checking every 45 seconds or so to see which clients are still checking in.
Now, the one issue with this is that there are times when the flash player may "forget" to make a call or two. So, give them a chance. Have the server set a "missed a call" variable on the user. Then check against that the next time. If it's true and they still haven't called in (this will be the second time), then you can be reasonably sure that they're not there anymore.
This is a bit of an intense way to deal with ghosts in your app, but should work rather well for all purposes intended. Hope that helps somebody out there as I'm sure there are those that have yet to find the solution to this until MS deals with their crappy browser issues.
Posted by Graeme at May 22, 2009 09:10 AM