From 235a90b0a7073a1de24eb2b387668898e0d0b088 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Thu, 15 Aug 2024 02:46:04 +0200 Subject: [PATCH] Replace os.exit with wails quit Exit would prevent defers from running which meant db would be left dangling --- app.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app.go b/app.go index 757fe70..3c9def8 100644 --- a/app.go +++ b/app.go @@ -2,7 +2,8 @@ package main import ( "context" - "os" + + "github.com/wailsapp/wails/v2/pkg/runtime" ) // App struct @@ -139,5 +140,5 @@ func (a *App) SetSetting(key string, value int64) WailsGenericAck { //region other func (a *App) Close() { - os.Exit(0) + runtime.Quit(a.ctx) } \ No newline at end of file