kanugula wrote: > Hi, > > Using Demo Browser terminology for simplicity. > > If I have something like > var window = new qx.ui.window.Window(); > var group = new qx.ui.groupbox.GroupBox(); > var label = new qx.ui.basic.Label(); > group.add(label); > window.add(group); > > this.window=window; > this.group=group; > this.label=label; > > 1) Is it enough to just destruct "window" object only, instead of all the > underlying so many tiny objects like group, label,e.t.c. > destruct : function() > { > this._disposeObjects("window"); > } >
No. As a rule of thumb, you have to dispose everything you attached to 'this'. The '_disposeObjects("window")' call would really just dispose the 'window' object. > 2) Wouldn't it be nice to have the above functionality in > disposeObjectDeep("window", 1) where the object will recursively look for > its elements, not only for Maps and Arrays as per the framework code. > Actually, I would have expected it does just that, disposing referenced objects recursively. Doesn't it?! You could check it with the description given here: http://qooxdoo.org/documentation/0.7/destructor_support#how_to_test_the_destructor But the check might complain anyway since it would still find the this.group and this.label members. Try it. > 3) Sometimes I have seen a long running dispose() in Demo Browser when you > jump from one page to another under examples. I believe it could be because > of the time taken for destruct() to complete > on last page. A dumb question. Can I put dispose() asynchronously without > the risk of same object collision? > I'm not sure I'm getting you right here. If you switch between examples in Demobrowser, you are switching between self-contained pages in the demo iframe, which means there is a complete unload/load cycle, and I don't think there is a way around it. And yes, the disposer runs on unload which consumes time (but also prevents memory pollution in the browser). But you cannot run the disposer earlier - well, in fact you can, but then the whole demo application is reduced to a frozen image where nothing continues to work, since all the objects that do the work are gone :). And you cannot dispose after the new page has loaded - "in the background" so to speak - since unfortunately different pages do not run in different interpreter instances (I wish they would). And two apps living side by side in the interpreter ... I'm not sure how this could be handled. HTH, Thomas > Thanks. > Kanugula. > > ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel