diff --git a/internal/app/lifecycle.go b/internal/app/lifecycle.go index 71c826d93a..169bdcb9f6 100644 --- a/internal/app/lifecycle.go +++ b/internal/app/lifecycle.go @@ -50,40 +50,40 @@ func (l *Lifecycle) SetOnStopped(f func()) { // TriggerEnteredForeground will call the focus gained hook, if one is registered. func (l *Lifecycle) TriggerEnteredForeground() { - f := *l.onForeground.Load() + f := l.onForeground.Load() if f == nil { return } - f() + (*f)() } // TriggerExitedForeground will call the focus lost hook, if one is registered. func (l *Lifecycle) TriggerExitedForeground() { - f := *l.onBackground.Load() + f := l.onBackground.Load() if f == nil { return } - f() + (*f)() } // TriggerStarted will call the started hook, if one is registered. func (l *Lifecycle) TriggerStarted() { - f := *l.onStarted.Load() + f := l.onStarted.Load() if f == nil { return } - f() + (*f)() } // TriggerStopped will call the stopped hook, if one is registered, // and an internal stopped hook after that. func (l *Lifecycle) TriggerStopped() { - f := *l.onStopped.Load() + f := l.onStopped.Load() if f != nil { - f() + (*f)() } if l.onStoppedHookExecuted != nil { diff --git a/widget/bind_helper.go b/widget/bind_helper.go index 069c5ed0cf..019424b5da 100644 --- a/widget/bind_helper.go +++ b/widget/bind_helper.go @@ -19,12 +19,12 @@ type basicBinder struct { // Bind replaces the data item whose changes are tracked by the callback function. func (binder *basicBinder) Bind(data binding.DataItem) { listener := binding.NewDataListener(func() { // NB: listener captures `data` but always calls the up-to-date callback - f := *binder.callback.Load() + f := binder.callback.Load() if f == nil { return } - f(data) + (*f)(data) }) data.AddListener(listener) listenerInfo := annotatedListener{