Address CodeRabbit review on embedded VNC PR

This commit is contained in:
Viktor Liu
2026-05-24 18:52:57 +02:00
parent 4e3e3ce6d3
commit bf2fb2fd44
7 changed files with 58 additions and 14 deletions
+5 -1
View File
@@ -324,7 +324,11 @@ func spawnAgentInSession(sessionID uint32, socketPath, authToken string, jobHand
}
if _, err := windows.ResumeThread(pi.Thread); err != nil {
log.Warnf("resume agent main thread: %v", err)
_ = windows.CloseHandle(pi.Thread)
_ = windows.TerminateProcess(pi.Process, 1)
_ = windows.CloseHandle(pi.Process)
_ = windows.CloseHandle(stderrRead)
return 0, fmt.Errorf("ResumeThread: %w", err)
}
_ = windows.CloseHandle(pi.Thread)