On 02/25/2013 12:51 PM, Michal Dvor(ák wrote:
Hello,
*What is the proper way to dispose properties?*
*
*
1. How to technically do it.
2. Who should do it? Since owning object doesn't have be aware of what is being set to it. But still in some cases it might be proper way..

The general strategy is that the code *setting* the property from outside is responsible for disposing the property's value. The object holding the property has no way of knowing whether the same value might be set to a property of another object. So it cannot dispose the value, or the other object gets an invalid value.

Whether the code setting the property has to be concerned about disposing the value depends on the type of the value. Primitive types (boolean, string, number, ...) are harmeless; JS reference types ([], {}, ...) are automatically reclaimed by the garbage collector, unless they hold references e.g. into the DOM; qooxdoo objects (deriving from qx.core.Object) have always to be disposed, as there is always a reference to them from the ObjectRegistry.

T.

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to