Opened 11 years ago

Closed 11 years ago

#6063 closed defect (fixed)

Putting IE event code inside of (almost) any closure causes leaks

Reported by: sjmiles Owned by: sjmiles
Priority: high Milestone: 1.1
Component: Core Version: 1.0
Keywords: Cc:
Blocked By: Blocking:

Description

The IE event connect code goes to great links to avoid attaching anything but primitive values to event handlers to avoid confusing the IE garbage collector. It's easy to accidentally attach references to handlers via closures (there is a warnung in the code to that effect.)

Sometimes Dojo itself gets put in a closure which causes leaks (in particular, the new scope mapping stuff uses this technique).

Fix: replacing the inline dispatcher function with a function created via new keyword provides more robust closure prevention.

Change History (1)

comment:1 Changed 11 years ago by sjmiles

Resolution: fixed
Status: newclosed

(In [12848]) Fixes #6050, make sure to clear _stealthKeydownHandle, so key listener can be reconnected later.
Fixes #6063, use new Function() to generate "pure" (closes over nothing) functions. !strict (return value complaints)

Note: See TracTickets for help on using tickets.