HybridManager: improve widget disposal#2085
Open
fschinkel wants to merge 2 commits intoreleases/26.2from
Open
Conversation
411586d to
c572753
Compare
c572753 to
a8d6765
Compare
cguglielmo
reviewed
Mar 30, 2026
1e9ab18 to
b040482
Compare
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
b040482 to
05be66b
Compare
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
05be66b to
0b202d8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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