qooxdoo icon indicating copy to clipboard operation
qooxdoo copied to clipboard

Calling widget.dispose() doesn't remove the widget from the layout parent.

Open lucapivato opened this issue 2 years ago • 2 comments

Not sure if this is a bug or the intended behavior. I'm going to change it in our branch.

In the destroy method in qx.ui.core.Widget it checks if the widget is already disposed and exists if it is. However, calling dispose() on a widget it sets the this.$$disposed flag to true and then calls the destructors second, and since parent_remove(this) in Widget.destroy() comes after the $$disposed check calling dispose() leaves disposed widget as invalid children.

Calling destroy() on the widget remove it but queues the disposal(). It seems to me that it would be more consistent to remove the widget from the layout parent also if calling dispose().

lucapivato avatar Dec 20 '22 20:12 lucapivato

Could you create a PR please?

hkollmann avatar Dec 20 '22 20:12 hkollmann

Looks like the Destroy test doesn't like it.

BTW this is a repro simple case: https://tinyurl.com/bdcss7db

lucapivato avatar Dec 20 '22 21:12 lucapivato