🐛 Windows 端部分系统上内核崩溃 https://github.com/siyuan-note/siyuan/issues/7806

This commit is contained in:
Liang Ding 2023-03-28 19:04:49 +08:00
parent d55af3966d
commit 55076cc89c
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -315,7 +315,12 @@ func existAvailabilityStatus(workspaceAbsPath string) bool {
logging.LogInfof("check workspace [%s] availability status", checkAbsPath)
ole.CoInitializeEx(0, ole.COINIT_MULTITHREADED)
runtime.LockOSThread()
defer runtime.LockOSThread()
if err := ole.CoInitializeEx(0, ole.COINIT_MULTITHREADED); nil != err {
logging.LogWarnf("initialize ole failed: %s", err)
return false
}
defer ole.CoUninitialize()
dir, file := filepath.Split(checkAbsPath)
unknown, err := oleutil.CreateObject("Shell.Application")