More widget cleanup

This commit is contained in:
nathan 2025-02-20 14:06:32 -07:00
parent 3793108c58
commit 0e15989eda
5 changed files with 8 additions and 3 deletions

View File

@ -104,7 +104,7 @@ export class Et2SelectCategory extends Et2StaticSelectMixin(Et2TreeDropdown)
const box = this.shadowRoot?.querySelector('.tree-dropdown__combobox');
if(box)
{
this.egw().tooltipUnbind(box, this.egw().lang(this.statustext));
this.egw().tooltipUnbind(box);
}
}

View File

@ -804,12 +804,11 @@ const Et2WidgetMixin = <T extends Constructor>(superClass : T) =>
// Clear any deferred properties, functions may live in here
this._deferred_properties = {};
// Not really needed, use the disconnectedCallback() and let the browser handle it
// Call the destructor of all children so any legacy widgets get destroyed
for(let i = this.getChildren().length - 1; i >= 0; i--)
{
this.getChildren()[i].destroy();
this.getChildren()[i] instanceof Et2WidgetClass && (<Et2WidgetClass>this.getChildren()[i]).remove();
}
// Free the array managers if they belong to this widget

View File

@ -301,12 +301,14 @@ export class et2_widget extends ClassWithAttributes
{
this._children[i].destroy();
}
this._children.splice(0, this._children.length);
// Remove this element from the parent, if it exists
if(typeof this._parent != "undefined" && this._parent !== null && this._parent instanceof et2_widget)
{
this._parent.removeChild(this);
}
this._parent = null;
// Free the array managers if they belong to this widget
for (var key in this._mgrs)

View File

@ -249,6 +249,7 @@ export class et2_customfields_list extends et2_valueWidget implements et2_IDetac
this.widgets = {};
this.detachedNodes = [];
this.tbody = null;
this.table = null;
}
/**

View File

@ -61,8 +61,11 @@ export class et2_nextmatch_rowProvider
destroy()
{
this._rowProvider.destroy();
this._rowProvider = null;
this._subgridCallback = null;
this._context = null;
this._rootWidget = null;
this._template = null;
this._dataRow = null;
}