Opened 12 years ago
Closed 12 years ago
#9424 closed defect (fixed)
dojo.delegate() can leak the last object
Reported by: | Eugene Lazutkin | Owned by: | Eugene Lazutkin |
---|---|---|---|
Priority: | lowest | Milestone: | 1.4 |
Component: | Core | Version: | 1.3.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
dojo.delegate()
retains a reference to the last used object thus pseudo-leaking it.
It can be fixed like that (in dojo/_base/lang.js
):
dojo.delegate = dojo._delegate = (function(){ // boodman/crockford delegation w/ cornford optimization function TMP(){} return function(obj, props){ TMP.prototype = obj; var tmp = new TMP(); if(props){ dojo._mixin(tmp, props); } // THE NEXT LINE CLEARS THE REFERENCE TMP.prototype = null; return tmp; // Object } })();
Change History (2)
comment:1 Changed 12 years ago by
Component: | General → Core |
---|---|
Milestone: | tbd → 1.4 |
Owner: | changed from anonymous to Eugene Lazutkin |
Status: | new → assigned |
comment:2 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note: See
TracTickets for help on using
tickets.
(In [18621]) dojo.delegate: removing a leak, !strict, fixes #9424.