Skip to content

HybridManager: improve widget disposal#2085

Open
fschinkel wants to merge 2 commits intoreleases/26.2from
features/fschinkel/26.2/hybrid-manager-dispose-widgets
Open

HybridManager: improve widget disposal#2085
fschinkel wants to merge 2 commits intoreleases/26.2from
features/fschinkel/26.2/hybrid-manager-dispose-widgets

Conversation

@fschinkel
Copy link
Copy Markdown
Member

Add api to HybridManager.ts for widget disposal. Widgets that need to be disposed are collected and the scout.DisposeWidgets-hybrid action is only called once. In addition, listen for destroyed widgets and send a scout.DisposeWidgets-hybrid action as well.
All widgets for which a disposal was scheduled are excluded from property change events in the future as destroyed widgets may no longer be resolved.
Improve performance of DisposeWidgetsHybridAction. The HybridManager adds dispose-listeners to all its widgets and removes them from itself when they are disposed. For this the HybridManager needs to build a new map of widgets, each time its "widgets" property is updated. If a great amount of widgets is disposed, each disposal triggers a rebuild of the HybridManagers "widgets" property. The DisposeWidgetsHybridAction will now remove all widgets that are to be disposed from the HybridManager at once and dispose them afterward. With this the "widgets" property of the HybridManager is only updated once which improves performance when great amounts of widgets are disposed.

379008

@fschinkel fschinkel requested a review from cguglielmo March 9, 2026 13:23
@fschinkel fschinkel self-assigned this Mar 9, 2026
@fschinkel fschinkel force-pushed the features/fschinkel/26.2/hybrid-manager-dispose-widgets branch 4 times, most recently from 411586d to c572753 Compare March 18, 2026 10:36
@fschinkel fschinkel force-pushed the features/fschinkel/26.2/hybrid-manager-dispose-widgets branch from c572753 to a8d6765 Compare March 23, 2026 05:45
Comment thread eclipse-scout-core/src/desktop/hybrid/HybridManager.ts Outdated
Comment thread eclipse-scout-core/src/desktop/hybrid/HybridManager.ts
Comment thread eclipse-scout-core/src/desktop/hybrid/HybridManager.ts Outdated
@fschinkel fschinkel force-pushed the features/fschinkel/26.2/hybrid-manager-dispose-widgets branch 4 times, most recently from 1e9ab18 to b040482 Compare April 16, 2026 09:32
Add api to HybridManager.ts for widget disposal. Widgets that need to be
disposed are collected and the scout.DisposeWidgets-hybrid action is
only called once. In addition, listen for destroyed widgets and send a
scout.DisposeWidgets-hybrid action as well.
All widgets for which a disposal was scheduled are excluded from
property change events in the future as destroyed widgets may no longer
be resolved.
Improve performance of DisposeWidgetsHybridAction. The HybridManager
adds dispose-listeners to all its widgets and removes them from itself
when they are disposed. For this the HybridManager needs to build a new
map of widgets, each time its "widgets" property is updated. If a great
amount of widgets is disposed, each disposal triggers a rebuild of the
HybridManagers "widgets" property. The DisposeWidgetsHybridAction will
now remove all widgets that are to be disposed from the HybridManager at
once and dispose them afterward. With this the "widgets" property of the
HybridManager is only updated once which improves performance when great
amounts of widgets are disposed.

379008
@fschinkel fschinkel force-pushed the features/fschinkel/26.2/hybrid-manager-dispose-widgets branch from b040482 to 05be66b Compare April 16, 2026 11:19
Add api to HybridManager.ts for widget disposal. Widgets that need to be
disposed are collected and the scout.DisposeWidgets-hybrid action is
only called once. In addition, send a scout.DisposeWidgets-hybrid action
and stop destroying for all widgets belonging to the HybridManager if
they are destroyed.
All widgets for which a disposal was scheduled are excluded from
property change events in the future as destroyed widgets may no longer
be resolved.
Improve performance of DisposeWidgetsHybridAction. The HybridManager
adds dispose-listeners to all its widgets and removes them from itself
when they are disposed. For this the HybridManager needs to build a new
map of widgets, each time its "widgets" property is updated. If a great
amount of widgets is disposed, each disposal triggers a rebuild of the
HybridManagers "widgets" property. The DisposeWidgetsHybridAction will
now remove all widgets that are to be disposed from the HybridManager at
once and dispose them afterward. With this the "widgets" property of the
HybridManager is only updated once which improves performance when great
amounts of widgets are disposed.

379008
@fschinkel fschinkel force-pushed the features/fschinkel/26.2/hybrid-manager-dispose-widgets branch from 05be66b to 0b202d8 Compare April 16, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants