Hello,
I am developping a mini CMS (to manage article/comments on a web site) using
Qooxdoo as frontend and PHP as backend. Under IE6, my app become quickly
heavy in memory and finally the more and more slow (due to the growth of
object in memory?).
I've developped my app without take care of memory usage and now it is
become the more and more urgent before enhance my CMS with new features.
Regarding my last email, what is the best strategy to free memory ?
In the Qooxdoo forum, I've more or less this sequence to free memory :
obj.removeAll(); // remove all chid of a object
qx.ui.core.ClientDocument.getInstance().remove(obj); //remove a object from
the page (from the DOM?)
obj.dispose(); //dispose object (from Qooxdoo internal arrays?)
obj=null; // reinit the object
Does all children object are freeing from memory with obj.removeAll() ?
Do you know if method (remove/removeAll/dispose) remove event listener on my
object ?
Is it possible to have an automatic deletion of object on a specific event
for example "afterdisappear" event ?
What about a garbage collector to reorganize internal array to safe memory ?
Thanks in advance for any help on this subject.
frederic
frederic wrote:
>
> Hello,
> What is the best way to dispose object ? In the bottom of this post, I
> have added a sample.
> My sample code is very simple :
> - a button "OPEN WINDOW" is displayed in the main window.
> - when click on this button, a modal window is displayed with a close
> button.
> - when the close button is clicked, the modal window is closed and I try
> at this time to dispose the modal window to free memory.
>
> My code doesn't work.
>
> How/when dispose the modal window myWindow ?
> All children objects (btClose,myLabel) are disposed when modal window is
> disposed ?
>
> thanks for your help.
>
> frederic
>
>
> -------------------------------------------------------------------------------------
>
> qx.OO.defineClass("custom.Application", qx.component.AbstractApplication,
> function () { qx.component.AbstractApplication.call(this);});
>
> qx.Proto.main = function(){
> var btOpen=new qx.ui.form.Button("OPEN WINDOW")
> btOpen.addToDocument();
> btOpen.addEventListener("execute",this.Test,this);
> };
>
> qx.Proto.Test = function(){
> var myWindow=new qx.ui.window.Window();
> myWindow.setCaption("TEST DISPOSE WINDOW");
> myWindow.setBackgroundColor("#b7e54a");
> myWindow.setSpace(100,200,100,200);
> myWindow.set({modal:true, showMaximize:false, showMinimize:false,
> showClose:true, resizeable:false, allowClose:true, allowMaximize:false,
> allowMinimize:false });
> var myLabel=new qx.ui.basic.Label("a label...")
> myWindow.add(myLabel);
> var btClose=new qx.ui.form.Button("CLOSE WINDOW");
> btClose.addEventListener("execute",function(){
> myWindow.close();
> });
> myWindow.add(btClose);
> myWindow.addToDocument();
> myWindow.open();
> myWindow.addEventListener("appear",function(){
> myWindow.debug("center...");
> myWindow.centerToBrowser();
> });
> myWindow.addEventListener("disappear",function(){
> myWindow.debug("dispose...");
> myWindow.dispose();
> });
> };
>
>
>
--
View this message in context:
http://www.nabble.com/When-How-dispose-object---tf2653619.html#a7421770
Sent from the qooxdoo-devel mailing list archive at Nabble.com.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel