改进退出程序时关闭数据库写入

This commit is contained in:
刘祥超
2023-06-23 17:45:39 +08:00
parent 8edd30bdd8
commit b6cab3919a
12 changed files with 25 additions and 10 deletions

View File

@@ -30,7 +30,7 @@ type DB struct {
func NewDB(path string) *DB {
var db = &DB{path: path}
events.On(events.EventQuit, func() {
events.OnClose(func() {
_ = db.Close()
})