Mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cliff Zhao" <zha...@gmail.com>
Subject Tapestry leaks memory in IE and my workaround
Date Fri, 23 Jun 2006 19:14:59 GMT
Tapestry leaks memory in IE. I'm using Tap 4.0.2. I did some research and
like to share it with you. The leaks may be more than I listed here as I did
not use client side validation on forms.

Tapestry form and DatePicker leak memory IE, here is what I did to remove
the leaks.

// the following code is to hack IE memory leaks.
if (typeof Calendar=="function") {
    var tap_calendar_create=Calendar.prototype.create;
    Calendar.prototype.create=function() {
        tap_calendar_create.call(this);
        dojo.event.browser.addClobberNodeAttrs
(this._previousMonth,["onclick"]);
        dojo.event.browser.addClobberNodeAttrs(this._nextMonth,["onclick"]);
        dojo.event.browser.addClobberNodeAttrs
(this._todayButton,["onclick"]);
        dojo.event.browser.addClobberNodeAttrs
(this._clearButton,["onclick"]);
        dojo.event.browser.addClobberNodeAttrs
(this._calDiv,["onselectstart","onkeydown","onmousewheel"]);
        dojo.event.browser.addClobberNodeAttrs(this._table,["onclick"]);
        dojo.event.browser.addClobberNodeAttrs
(this._monthSelect,["onchange","onclick"]);
        dojo.event.browser.addClobberNodeAttrs
(this._yearSelect,["onchange"]);
        return this._calDiv;
    };
}

if (typeof Tapestry=="object") {
    Tapestry.register_form = function(formId)
    {
      var form = this.find(formId);

      form.events = new FormEventManager(form);
      dojo.event.browser.addClobberNodeAttrs
(form,["events","onsubmit","onreset"]);
    };
}


Best Regards,
Cliff Zhao

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message