🎨 重构关闭笔记本

This commit is contained in:
Liang Ding 2023-01-15 14:00:01 +08:00
parent 10c810a02c
commit 0f82fb3fce
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -123,16 +123,16 @@ func Unmount(boxID string) {
} }
func unmount0(boxID string) { func unmount0(boxID string) {
for _, box := range Conf.GetOpenedBoxes() { box := Conf.Box(boxID)
if box.ID == boxID { if nil == box {
return
}
boxConf := box.GetConf() boxConf := box.GetConf()
boxConf.Closed = true boxConf.Closed = true
box.SaveConf(boxConf) box.SaveConf(boxConf)
box.Unindex() box.Unindex()
debug.FreeOSMemory() debug.FreeOSMemory()
return
}
}
} }
func Mount(boxID string) (alreadyMount bool, err error) { func Mount(boxID string) (alreadyMount bool, err error) {