From df6e249cd4b66b6e6ad8d760370b9e938f3a9896 Mon Sep 17 00:00:00 2001 From: Jacalz Date: Thu, 23 Jan 2025 11:05:06 +0100 Subject: [PATCH] Make sure to not also grow cleanups to infinity --- cmd/fyne_demo/main.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/fyne_demo/main.go b/cmd/fyne_demo/main.go index 3f219d03d5..007d407b4d 100644 --- a/cmd/fyne_demo/main.go +++ b/cmd/fyne_demo/main.go @@ -228,12 +228,13 @@ func makeNav(setTutorial func(tutorial tutorials.Tutorial), loadPrevious bool) f }, OnSelected: func(uid string) { if t, ok := tutorials.Tutorials[uid]; ok { - a.Preferences().SetString(preferenceCurrentTutorial, uid) - setTutorial(t) - for _, f := range tutorials.OnChangeFuncs { f(uid) } + tutorials.OnChangeFuncs = nil // Loading a page registers a new cleanup. + + a.Preferences().SetString(preferenceCurrentTutorial, uid) + setTutorial(t) } }, }