Ticket #2461 (closed defect: fixed)
Destroy Dialog does not clean up all references to the dialog elements and the memory for those elements is not freed
| Reported by: | adishabnave@… | Owned by: | bill |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.2 |
| Component: | Dijit | Version: | 0.4.1 |
| Severity: | normal | Keywords: | |
| Cc: | males.ext@…, bhouee.ext@… |
Description (last modified by jfcunat) (diff)
When i create a dialog programatically and then destroy it, references to the dialog nodes are not cleared and the nodes keep occupying memory.
To check if the nodes are getting freed i am using sIeve. http://home.wanadoo.nl/jsrosman/
The dojo version is 0.4.1
Below is a sample test case which is a simplified version of the dojo test_Dialog_createWidget.html 1.) Open the page in sIeve 2.) In sIeve, do 'clear in use' nodes and click on the 'Show Dialog Link' 3.) Now,do 'show in use' nodes to see the nodes created by the dialog. 4.) Click on the 'hide dialog' link and see some nodes getting freed but not all.
Shouldn't all the dialog nodes be freed and reclaim memory ?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
<html> <head> <title>Dialog Widget Dojo Tests</title> <script type="text/javascript" src="../../dojo.js"></script> <script type="text/javascript">
dojo.require("dojo.widget.Dialog");
</script>
<script type="text/javascript"> function init() {
var dlgProg = dojo.widget.createWidget("dojo:Dialog",{id:'testDialog', toggle:"fade",toggleDuration:250,bgOpacity:0}, dojo.byId("dialogNode")); dlgProg.show();
}
</script> <style type="text/css"> body { font-family : sans-serif; } .dojoDialog {
background : #eee; border : 1px solid #999; -moz-border-radius : 5px; padding : 4px;
}
form {
margin-bottom : 0;
} </style> </head> <body> <a href="javascript:init()">Show Dialog</a> <a href="javascript:dojo.widget.byId('testDialog').destroy()">Hide Dialog</a> <div id="dialogNode">
<p>Testing Dialog Memory Leak!</p>
</div> </body> </html>
Thanks, Adish