From 0f82fb3fce65dc820a2165c824a400cabb0523a3 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sun, 15 Jan 2023 14:00:01 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E9=87=8D=E6=9E=84=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E7=AC=94=E8=AE=B0=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/mount.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/kernel/model/mount.go b/kernel/model/mount.go index ec895d5f1..e3ac12ef8 100644 --- a/kernel/model/mount.go +++ b/kernel/model/mount.go @@ -123,16 +123,16 @@ func Unmount(boxID string) { } func unmount0(boxID string) { - for _, box := range Conf.GetOpenedBoxes() { - if box.ID == boxID { - boxConf := box.GetConf() - boxConf.Closed = true - box.SaveConf(boxConf) - box.Unindex() - debug.FreeOSMemory() - return - } + box := Conf.Box(boxID) + if nil == box { + return } + + boxConf := box.GetConf() + boxConf.Closed = true + box.SaveConf(boxConf) + box.Unindex() + debug.FreeOSMemory() } func Mount(boxID string) (alreadyMount bool, err error) {