Skip to content

Commit

Permalink
make sure to delete theme override map entry wherever we destroy rend…
Browse files Browse the repository at this point in the history
…erer
  • Loading branch information
dweymouth committed Jul 15, 2024
1 parent 04746cc commit 4e81210
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions internal/cache/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,12 @@ func CleanCanvas(canvas fyne.Canvas) {
if !ok {
continue
}
winfo, ok := renderers[wid]
rinfo, ok := renderers[wid]
if !ok {
continue
}
winfo.renderer.Destroy()
rinfo.renderer.Destroy()
overrides.Delete(wid)
delete(renderers, wid)
}
renderersLock.Unlock()
Expand Down Expand Up @@ -135,13 +136,12 @@ func CleanCanvases(refreshingCanvases []fyne.Canvas) {
continue
}
rinfo, ok := renderers[wid]
if !ok {
if !ok || !rinfo.isExpired(now) {
continue
}
if rinfo.isExpired(now) {
rinfo.renderer.Destroy()
delete(renderers, wid)
}
rinfo.renderer.Destroy()
overrides.Delete(wid)
delete(renderers, wid)
}
renderersLock.Unlock()
lastClean = timeNow()
Expand Down Expand Up @@ -187,6 +187,7 @@ func destroyExpiredRenderers(now time.Time) {
for wid, rinfo := range renderers {
if rinfo.isExpired(now) {
rinfo.renderer.Destroy()
overrides.Delete(wid)
expiredObjects = append(expiredObjects, wid)
}
}
Expand Down

0 comments on commit 4e81210

Please sign in to comment.