Hey,

I am currently looking into some memory leak reports and I am finding the 
“qx.disposerDebugLevel” very useful.
It is in deed.

When looking at the reporting of objects not being disposed (in Object.js, 
“Missing destruct definition for…”) I see several issues about objects in the 
Qooxdoo framework (I am using V1.4.1):
053884 Missing destruct definition for '$$user_behavior' in 
qx.ui.table.columnmodel.Resize[undefined]: 
qx.ui.table.columnmodel.resizebehavior.Default[503]
053885 Missing destruct definition for '$$user_selectionModel' in 
qx.ui.treevirtual.SelectionManager[undefined]: 
qx.ui.table.selection.Model[undefined]
053892 Missing destruct definition for '$$user_dataRowRenderer' in 
webgui.ui.tree.ComtecTree[undefined]: 
webgui.ui.tree.ComtecTreeRowRenderer[undefined]
053892 Missing destruct definition for '$$user_selectionModel' in 
webgui.ui.tree.ComtecTree[undefined]: qx.ui.table.selection.Model[undefined]
053893 Missing destruct definition for '$$user_tableModel' in 
webgui.ui.tree.ComtecTree[undefined]: qx.ui.treevirtual.SimpleTreeDataModel[482]
053893 Missing destruct definition for '$$user_metaColumnCounts' in 
webgui.ui.tree.ComtecTree[undefined]: 1
053902 Missing destruct definition for '$$user_decorator' in 
qx.ui.core.Widget[undefined]: qx.ui.decoration.Background[458]
056719 Missing destruct definition for '$$user_tablePaneModel' in 
qx.ui.table.pane.Scroller[undefined]: qx.ui.table.pane.Model[undefined]
056723 Missing destruct definition for '$$user_menu' in 
qx.ui.table.columnmenu.Button[undefined]: qx.ui.menu.Menu[616]
056729 Missing destruct definition for '$$user_opener' in 
qx.ui.menu.Menu[undefined]: qx.ui.table.columnmenu.Button[undefined]
065634 Missing destruct definition for '$$user_toolTip' in 
qx.ui.toolbar.Button[undefined]: qx.ui.tooltip.ToolTip[473]

Most seem to have to do with classes I derive from, like “qx.ui.table.Table”, 
and where I use the construction with the “custom” argument to call the 
base-constructor with overrides for the tablePane, selectionModel etcetera. Is 
there something I should do in the dispose of my own objects? I was expecting 
code like in “qx.ui.table.Table._applySelectionModel” to dispose any selection 
model if a new one is set.
No, the framework should take care of the necessary stuff itself. If thats not 
the case, feel free to open up a bug report for it. :)
The problem here is, that we can only detect if there is still an object at a 
given reference and thats it. This is more a "this might need to be removed" 
than a "this has to be removed". Memory leak detection is unfortunately not as 
easy due to the really good garbage collection in the browsers. There is no 
problem if one objects references another if both don't have a connection to 
the global or current scope or to the DOM. As you can guess, thats impossible 
to detect by an algorithm. ;)

Futhermore I have a lot of buttons with a tooltip set using “someWidget. 
setToolTip(new qx.ui.tooltip.ToolTip("some text"))” and I didn’t expect having 
to dispose them myself. I hope you can tell me how I can fix these issues (if 
necessary that is).

The framework code usually uses the guidline that the one creating the obejct 
is responsible for its disposing. As you are the one creating it, you have to 
dispose it. Think about a situation where you build your own shared tool tip 
and don't want someone else to dispose your shared tool tip.
As the tooltip derives from qx.core.Object, you should dispose it. Otherwise, 
the tooltips will stay in memory due to the reference to the global scope via 
the object registry.
To do so, you could either sore a reference to the tooltip and dipose it on 
widget dispose or use the getToolTip function before disposing. If you are 
having that a lot, it might be a good candidate to write a helper for that.

I hope that helped a bit,
Martin
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to