[Laszlo-dev] For Review: Change 20061103-Philip-8 Summary: Timer function must check element because it might have been deleted.

Philip Romanik promanik at laszlosystems.com
Fri Nov 3 10:40:09 PST 2006


This didn't help. Looks like the timer needs a call to clearTimeout() in 
order to kill the callback.

>Perhaps we aren't doing a thorough enough job destroying images when
>destroy() is called.  If this change does the job I'd prefer it:
>
>LzSprite.prototype.destroy = function(recursive) {
>...
>      if (this.__LZimg) {
>          LzSprite.prototype.__destroyImage(this.__LZimg);
>      }
>...
>}
>
>It would be better to prevent the event from firing if at all possible.
>   Let me know if this works!
>
>-Max
>
>Philip Romanik wrote:
> > Hi Max.
> >
> > Here's the contents of apply.sh:
> >
> > patch -bu -p0 <<"EOF"
> > Index: WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
> > ===================================================================
> > --- WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js    (revision 2383)
> > +++ WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js    (working copy)
> > @@ -702,7 +702,9 @@
> >                  setTimeout(this.onloadforeal, 1);
> >              }
> >              im.sizer.onloadforeal = function() {
> > -                im.owner.__imgonload(im.sizer);
> > +                if (im.owner && im.sizer) {  // Discarded by
> > __destroyImage?
> > +                    im.owner.__imgonload(im.sizer);
> > +                }
> >              }
> >              im.sizer.src = url;
> >          }
> > EOF
> >
> >> Hi Phil,
> >>
> >> I can't seem to download the patch file - even after removing the
> >> trailing backslash.  Can you send it again?  Thanks!
> >>
> >> -Max
> >
> >



More information about the Laszlo-dev mailing list