mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 内核垃圾回收
This commit is contained in:
parent
eea6c9468a
commit
74e7ecd5a5
8 changed files with 17 additions and 13 deletions
|
|
@ -25,6 +25,7 @@ import (
|
|||
"path/filepath"
|
||||
"regexp"
|
||||
"runtime"
|
||||
"runtime/debug"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
|
@ -1267,6 +1268,7 @@ func closeDatabase() (err error) {
|
|||
}
|
||||
|
||||
err = db.Close()
|
||||
debug.FreeOSMemory()
|
||||
runtime.GC() // 没有这句的话文件句柄不会释放,后面就无法删除文件
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue