Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#17692 closed defect (fixed)

Memory leak in dijit/form/TextBox

Reported by: Jared Jurkiewicz Owned by:
Priority: undecided Milestone: 1.9.4
Component: Dijit - Form Version: 1.9.2
Keywords: Cc:
Blocked By: Blocking:

Description

There is a connection/event leak in TextBox?.js related to handling of the placeholder span. Specifically:

this._phspan = domConstruct.create('span',{ onmousedown:function(e){ e.preventDefault(); }, className:'dijitPlaceHolder dijitInputField'},this.textbox,'after');

That causes an implicit on() call to occur when creating that node and that on handle is not owned by the widget, and therefore never gets removed. So the connection remains. This will cause memory leaks on older IE (and even possibly newer ones in some of my experience). I'll try to rework this and post a patch.

Change History (4)

comment:1 Changed 5 years ago by ztravis

Looks like this has been fixed in dijit master (though it didn't make it into 1.9.3): https://github.com/dojo/dijit/commit/db6c959d7e50e864f439f3e1f55769a31222b42e#diff-f5ae7fb43ce55079570aeb03c762d0a7

comment:2 Changed 5 years ago by bill

Milestone: tbd1.9.4
Resolution: fixed
Status: newclosed

Ah good. OK I backported to 1.9 in 5d4d2d35032f3ff8d173320b1d2df317cea775ce.

comment:3 Changed 5 years ago by dylan

Just curious, any reason to not backport to 1.8 and 1.7? (other than 1.8 doesn't appear to have any this.own logic within that block of code, so not a trivial backport)

comment:4 Changed 5 years ago by bill

No, there's no particular reason, feel free to backport it further, just be sure to run some regression tests (at least the validate one).

Note: See TracTickets for help on using tickets.