Replace os.exit with wails quit
Exit would prevent defers from running which meant db would be left dangling
This commit is contained in:
5
app.go
5
app.go
@@ -2,7 +2,8 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"os"
|
|
||||||
|
"github.com/wailsapp/wails/v2/pkg/runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
// App struct
|
// App struct
|
||||||
@@ -139,5 +140,5 @@ func (a *App) SetSetting(key string, value int64) WailsGenericAck {
|
|||||||
|
|
||||||
//region other
|
//region other
|
||||||
func (a *App) Close() {
|
func (a *App) Close() {
|
||||||
os.Exit(0)
|
runtime.Quit(a.ctx)
|
||||||
}
|
}
|
Reference in New Issue
Block a user