Hi there,

Am 13.06.2007 um 09:22 schrieb Sebastian Werner:

> Dietrich Streifert schrieb:
>> Shouldn't this be solved in general by modifying the  
>> _disposeObjects method?
>>
>> The disposal of an object makes a reference from its parent useless.
>>
>> So shouldn't some code like:
>>
>>     parent = objToDispose.getParent();
>>     if(parent) parent.remove(objToDispose);
>
> No, this is not a good idea. In most of the cases this will lead to
> unneeded DOM modifications especially when quiting the application
> (leaving the page).

What about specifically handling this case? There's already the  
__disposeAll flag in qx.core.Object which indicates whether the  
dispose is caused by a page unload or not.

We could automatically perform a setParent(null) when a widget is  
disposed manually, but not when the page is unloaded. I think this  
would save quite some work and would be easier to understand for  
developers (which means they're less likely to introduce leaks).

Regards,

   Andreas


>> be done for every parameter of _disposeObjects?
>>
>> Sebastian? Fabian?
>>
>>
>> Nick Glencross schrieb:
>>> Hi!
>>>
>>> I mentioned in a posting on the 8th that I was seeing a problem with
>>> tabbing after the DateChooserButton is destructed, and posted some
>>> sample code.
>>>
>>> I've further investigated this and found the problem lies in
>>> DateChooserButton's destruction of the popup window. Basically in  
>>> its
>>> destructor it uses _disposeObjects to call and unreference
>>> _chooserWindow, but this doesn't remove the window from its parent,
>>> and as such is still a child of the ClientDocument but in a disposed
>>> state. [As such, when the focus handler visits it is doesn't have a
>>> child array and so generates an error)
>>>
>>> I've attached a sample patch of some code to resolve it.
>>>
>>> Ironically having potentially fixed this, it's unmasked the same
>>> problem with the Tooltips in some code I've written!! (I've disposed
>>> them but not removed them from their parent)
>>>
>>> (As a side issue, is it a deliberate design decision not to remove
>>> Widgets from their parent when they are disposed?)
>>>
>>> Nick


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to