
|
If you were logged in you would be able to see more operations.
|
|
|
| Severity: |
Major
|
| Fixed in Change#: |
7,417
|
| Fixed in branch: |
trunk
|
| Runtime: |
N/A
|
| Flags: |
Regression
|
| Fix in hand: |
False
|
|
We've discovered a memory leak in basewindow. Windows create a windowlist on-the-fly to keep track of which window should be frontmost. That means that every time a window is created there's a reference created (which would stop it being garbage-collected).
Here's the bit of code:
<method name="init">
// Windows that are datamappped control their own visibility
if (this.datapath != null) {
this.datapath.setAttribute('datacontrolsvisibility',
this.visibility == "collapse");
}
super.init();
this.mousedown_del = new LzDelegate ( this, "_mousedown", this , "onmousedown" );
this.mouseup_del = new LzDelegate ( this, "_mouseup", this , "onmouseup" );
if (this.visible) {
var wlist = parent.options['windowlist'];
wlist.push(this); // frontmost window for now
this.setAttribute('haswindowfocus', true);
}
</method>
The destroy method should clear out the references in windowlist:
<!--- @keywords private -->
<method name="destroy">
<!-- TODO: [2005-04-07 ptw] remove when cleanup is automatic -->
if (this.mousedel) {
this.mousedel.unregisterAll();
}
super.destroy();
</method>
|
|
Description
|
We've discovered a memory leak in basewindow. Windows create a windowlist on-the-fly to keep track of which window should be frontmost. That means that every time a window is created there's a reference created (which would stop it being garbage-collected).
Here's the bit of code:
<method name="init">
// Windows that are datamappped control their own visibility
if (this.datapath != null) {
this.datapath.setAttribute('datacontrolsvisibility',
this.visibility == "collapse");
}
super.init();
this.mousedown_del = new LzDelegate ( this, "_mousedown", this , "onmousedown" );
this.mouseup_del = new LzDelegate ( this, "_mouseup", this , "onmouseup" );
if (this.visible) {
var wlist = parent.options['windowlist'];
wlist.push(this); // frontmost window for now
this.setAttribute('haswindowfocus', true);
}
</method>
The destroy method should clear out the references in windowlist:
<!--- @keywords private -->
<method name="destroy">
<!-- TODO: [2005-04-07 ptw] remove when cleanup is automatic -->
if (this.mousedel) {
this.mousedel.unregisterAll();
}
super.destroy();
</method>
|
Show » |
|
In old days, we were calling "setVisible(false)" in "LzView#destroy(..)", now it is "setVisibility( "hidden" )".
Therefore "basewindow#setVisible(..)" isn't called, which would have removed the basewindow from the windowlist-array.