From e7622cefde489b811e2717c02076f5dd388ce6b0 Mon Sep 17 00:00:00 2001 From: Drew Weymouth Date: Sun, 10 Dec 2023 14:23:09 -0800 Subject: [PATCH] make critical section shorter --- internal/animation/runner.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/animation/runner.go b/internal/animation/runner.go index bad7827aa2..11791fa375 100644 --- a/internal/animation/runner.go +++ b/internal/animation/runner.go @@ -19,9 +19,9 @@ type Runner struct { // Start will register the passed application and initiate its ticking. func (r *Runner) Start(a *fyne.Animation) { r.animationMutex.Lock() - defer r.animationMutex.Unlock() - r.pendingAnimations = append(r.pendingAnimations, newAnim(a)) + r.animationMutex.Unlock() + if !r.runnerStarted { r.runnerStarted = true r.runAnimations()