moxiecode/plupload — pull request #516 by ewit (2012-03-09 12:44:00+00:00)
Title: Fix for crash when destroying uploader right after init

When using plupload pages in javascript application, it often gets destroyed few seconds after it has been initialized. When this happens, plupload crashes after some time with an error caused by missing container (missing obj in getStyles, to be precise).
The problem seems to me to be the waitLoad function. When the pluploader is destroyed, the waitLoad function keeps waiting and calls the callback even after pluploader is destroyed.
My fix is to, first, move the destory logic into the first part of the code, so when the pluploader is destroyed the flash runtime handles it. Second, when waitLoad runs, I check if the pluploader is destroyed (initialized[uploaderId] is undefined) and if so aborts.

First fix was not working. Hope you like this one instead :)