From 4e812103d2602a6fd910d17fb7b62046f73f528f Mon Sep 17 00:00:00 2001 From: Drew Weymouth Date: Mon, 15 Jul 2024 08:09:41 -0700 Subject: [PATCH] make sure to delete theme override map entry wherever we destroy renderer --- internal/cache/base.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/internal/cache/base.go b/internal/cache/base.go index 183830dee6..c42cb3ce2a 100644 --- a/internal/cache/base.go +++ b/internal/cache/base.go @@ -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() @@ -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() @@ -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) } }