jim-jim-jim / base2

Automatically exported from code.google.com/p/base2
0 stars 0 forks source link

The MSIE event dispatch mechanism (both in base2.dom and JSB) leaks memory #125

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open the attached test-dom.html file in MSIE (tested on 7.0).
2. Move the mouse cursor over and out of the test div element.
3. Repeat 2.

This problem exists both in base2.dom and JSB. To test JSB use the attached
file test-jsb.html.

What is the expected output? What do you see instead?
Checking with memory leak detector like sIEve or just using the Task
Manager shows that IE is leaking memory.

What version of the product are you using? On what operating system?
base2: 1.1 (alpha1)
JSB: 0.9.6

Please provide any additional information below.
Performing the test without activating the event handlers (i.e. without
moving the mouse cursor over and out of the test div) does not show any
memory leaks.

The problem was found to be in the "onpropertychange" event handler that is
used to dispatch events in IE.

For base2.dom: adding "delete d.target; delete d.event; delete d.listener;"
at its end prevents the leaks.
For JSB: adding "delete d.listener;delete d.behavior;delete d.args;" at its
end prevents the leaks.

I'm not sure whether the above changes are really the correct fix, but they
definitely solved the problem for me.

Original issue reported on code.google.com by mdimitrov@gmail.com on 13 Dec 2009 at 1:59

Attachments:

GoogleCodeExporter commented 9 years ago
Note: in the attached files the paths to base2, base2-dom and base2-jsb must be 
fixed
to point to the correct js files.

Original comment by mdimitrov@gmail.com on 13 Dec 2009 at 2:22

GoogleCodeExporter commented 9 years ago
Thanks for the fix!

Original comment by dean.edw...@gmail.com on 13 Dec 2009 at 5:46