Harden icon cache concurrency (T-606)

This commit is contained in:
ila
2026-07-17 09:38:25 +08:00
parent 8873a5261d
commit f1cc7308db
17 changed files with 835 additions and 60 deletions
+5
View File
@@ -103,14 +103,19 @@ func (shell *AppShell) SetItems(items []application.CatalogListItem) {
shell.model.SetItems(items)
nextRows := make(map[string]*rowControls, len(items))
nextIcons := make(map[string]paint.ImageOp, len(items))
for _, item := range items {
controls := shell.rows[item.ID]
if controls == nil {
controls = new(rowControls)
}
nextRows[item.ID] = controls
if icon, exists := shell.icons[item.ID]; exists {
nextIcons[item.ID] = icon
}
}
shell.rows = nextRows
shell.icons = nextIcons
nextCategories := make(map[string]*widget.Clickable)
for _, category := range append([]string{""}, shell.model.Categories()...) {