diff --git a/app/app.go b/app/app.go index 677b06028c..d68e2db9ff 100644 --- a/app/app.go +++ b/app/app.go @@ -148,7 +148,7 @@ func newAppWithDriver(d fyne.Driver, id string) fyne.App { fyne.SetCurrentApp(newApp) newApp.prefs = newApp.newDefaultPreferences() - newApp.lifecycle.(*app.Lifecycle).SetAfterStopped(func() { + newApp.lifecycle.(*app.Lifecycle).SetOnStoppedHookExecuted(func() { if prefs, ok := newApp.prefs.(*preferences); ok { prefs.forceImmediateSave() } diff --git a/app/preferences.go b/app/preferences.go index 6aa4cbe874..9ada3f675c 100644 --- a/app/preferences.go +++ b/app/preferences.go @@ -62,7 +62,6 @@ func (p *preferences) saveToFile(path string) error { p.savedRecently = true p.prefLock.Unlock() defer p.resetSavedRecently() - err := os.MkdirAll(filepath.Dir(path), 0700) if err != nil { // this is not an exists error according to docs return err diff --git a/internal/app/lifecycle.go b/internal/app/lifecycle.go index 1e042e5c70..f85ec0f3dc 100644 --- a/internal/app/lifecycle.go +++ b/internal/app/lifecycle.go @@ -17,13 +17,13 @@ type Lifecycle struct { onStarted atomic.Value // func() onStopped atomic.Value // func() - internalAfterStoppedTrigger atomic.Value // func() + onStoppedHookExecuted atomic.Value // func() } -// SetAfterStopped is an internal function that lets Fyne schedule a clean-up after +// SetOnStoppedHookExecuted is an internal function that lets Fyne schedule a clean-up after // the user-provided stopped hook. -func (l *Lifecycle) SetAfterStopped(f func()) { - l.internalAfterStoppedTrigger.Store(f) +func (l *Lifecycle) SetOnStoppedHookExecuted(f func()) { + l.onStoppedHookExecuted.Store(f) } // SetOnEnteredForeground hooks into the the app becoming foreground. @@ -79,7 +79,7 @@ func (l *Lifecycle) TriggerStopped() { if ff, ok := f.(func()); ok && ff != nil { ff() } - f = l.internalAfterStoppedTrigger.Load() + f = l.onStoppedHookExecuted.Load() if ff, ok := f.(func()); ok && ff != nil { ff() }