From f2a94620ca8f3aacf2c8953add8f005ff771701b Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Wed, 8 Jan 2025 16:35:56 +0000 Subject: [PATCH] Races fixed up enough to close out the fyne_demo reports This is not using the final API but I wanted to progress tasks as while working on trickier details. I will move this to public API when it is decided, a simple refactor will cover it. In the meantime I can no longer get any reports from in fyne_demo --- cmd/fyne_demo/tutorials/canvas.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cmd/fyne_demo/tutorials/canvas.go b/cmd/fyne_demo/tutorials/canvas.go index afc5017a22..1c17e900cf 100644 --- a/cmd/fyne_demo/tutorials/canvas.go +++ b/cmd/fyne_demo/tutorials/canvas.go @@ -24,11 +24,13 @@ func canvasScreen(_ fyne.Window) fyne.CanvasObject { for { time.Sleep(time.Second) - gradient.Angle += 45 - if gradient.Angle >= 360 { - gradient.Angle -= 360 - } - canvas.Refresh(gradient) + fyne.CurrentApp().Driver().CallFromGoroutine(func() { + gradient.Angle += 45 + if gradient.Angle >= 360 { + gradient.Angle -= 360 + } + canvas.Refresh(gradient) + }) } }()