World Leaks in Safari, any clues to track down?

Discussion in 'Javascript' started by dd, Jan 17, 2007.

  1. dd

    dd Guest

    I have a page that works just fine on all OS'es/Browsers
    except Safari. When I close the page I get a world leak
    triggered by the JavaScript Interpreter. I know most people
    don't have the "always check for world leaks" on, so it's
    not like it's going to happen for Joe user, but I've got some
    code that Safari's JS interpreter isn't happy with and I want
    to track it down. Just like I do with anything that appears
    in the Firefox console, even if it's only a warning.

    Anyone have any useful tips for tracking down stuff in
    Safari? I was planning to start adding a return statement in
    my onunload handling code (because it only happens when
    I close the browser) and move the return further and further
    towards the end of the function, assuming that it'll keep
    working and working and then eventually I'll move the return
    to after the code that causes the world leak. It's annoying
    and time-consuming though :(
    dd, Jan 17, 2007
    #1
    1. Advertising

  2. dd

    dd Guest

    Forgot to mention I'm using Safari 10.3.2 (I can't get it
    to upgrade further than that because I'm stuck on OSX
    10.3.9 and newer versions of OSX come on DVD and
    my crappy iBook only has CDROM)...
    dd, Jan 17, 2007
    #2
    1. Advertising

  3. dd

    VK Guest

    dd wrote:
    > Forgot to mention I'm using Safari 10.3.2


    That's hardly given that the most recent version is only 2.0.4 ;-)
    That must be MacOS version 10.3.2, so Safari is no higher then than 1.3
    - that makes it pretty useless for debugging. It's like debugging right
    now on Mac IE 5.0 in hope to become ready for Win IE 6 and 7. Most of
    workarounds made will not be necessary, and the necessary workarounds
    will not be found. If you are targeted to cover Safari as well, then
    sorry but you need 2.0.4 - this is the only usable and anyhow
    acknowledged Safari version. Also you can get yourselve a nightly build
    from <http://webkit.org/> But I cannot guarantee that it will go on
    10.3.2

    As not a definitive guide of any kind but as recommendations that might
    be useful see also:
    <http://developer.yahoo.com/yui/articles/gbs/gbs_browser-chart.html>
    <http://developer.yahoo.com/yui/articles/gbs/gbs.html>
    VK, Jan 17, 2007
    #3
  4. dd

    dd Guest

    Yeah I know I need Tiger. The annoying thing is, I have
    the DVD for it, I just can't stick the darned thing in the
    drive :(

    Unfortunately my delivery matrix goes back to Safari
    1.2 so I have to support it.

    Luckily I just found the problem. Run-on cases in a
    switch statement. Safari JS interpreter doesn't like
    them. Here's what I had, reduced to example code:

    switch(p.charAt(0))
    {
    case "I":break;
    case "C":
    case "U":break;
    case "T":break;
    default:break;
    }

    I'm switching on a character rather than a number,
    but the crucial thing is the lack of a break on the
    "C" case because I want it to run through into the
    "U" case. Obviously I've taken the actual code out
    of the example just to leave the underlying structure.

    Once I put that break in, Safari is happy again. No
    more world leaks.
    dd, Jan 17, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. SeanGallavan
    Replies:
    0
    Views:
    523
    SeanGallavan
    Mar 1, 2005
  2. darrel
    Replies:
    5
    Views:
    405
    darrel
    Jul 9, 2007
  3. Brock
    Replies:
    1
    Views:
    760
    Teemu Keiski
    Jul 9, 2008
  4. sm6nnc
    Replies:
    4
    Views:
    668
    Rich Alderson
    Dec 2, 2008
  5. Victor Stinner
    Replies:
    0
    Views:
    113
    Victor Stinner
    Mar 7, 2013
Loading...

Share This Page