[thelist] JS memory leak detection?

liorean liorean at gmail.com
Mon Oct 24 05:30:38 CDT 2005


On 10/24/05, VOLKAN ÖZÇELİK <volkan.ozcelik at gmail.com> wrote:
>
> > > Just a note about that code you have there: The unload event isn't
> reliable
> > > for a number of reasons. Especially not in op. I suggest using
> > > onbeforeunload instead.
>
> Here are compatibility results for onbeforeunload:
>
> Opera 8 -> *it does not work*
> IE -> works okay
> Moz -> works okay
> Saf -> not tested
>
> So voting for onbeforeunload against onunload because Opera does not
> support ununload is kinda mistake. Because Opera does not support
> onbeforeunload at all.


I didn't say it was reliable in other browsers either. It's not. onunload is
called as the document is being dismantled, and if you're unlucky there
might be nothing left of the document, or the window for that matter, when
it executes. This depends on factors that are out of your control, such as
load on the CPU at the time the user closes the window/navigates away from
the page etc.
It's just less reliable in op than it is in the others because of the
difference in what they consider an unloading of the document. I've got a
CONFIRMED bug in Opera BTS about this behavior by the way, so they're not
considering the behavior they have correct. They are just not prepared to
run any JavaScript while the document is being dismantled yet.
--
David "liorean" Andersson
<uri:http://liorean.web-graphics.com/>


More information about the thelist mailing list