|
@@ -131,9 +131,18 @@ func (m *ChildProcManager) ForceKill(CPID int64) error {
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
+ if inst == nil {
|
|
|
+ return fmt.Errorf("can not force kill process (CPID=%16X): instance is nil", CPID)
|
|
|
+ }
|
|
|
inst.Lock()
|
|
|
+ defer inst.Unlock()
|
|
|
+ if inst.Cmd == nil {
|
|
|
+ return fmt.Errorf("can not force kill process (CPID=%16X): Cmd is nil", CPID)
|
|
|
+ }
|
|
|
+ if inst.Cmd.Process == nil {
|
|
|
+ return fmt.Errorf("can not force kill process (CPID=%16X): Cmd.Process is nil", CPID)
|
|
|
+ }
|
|
|
err = inst.Cmd.Process.Kill()
|
|
|
- inst.Unlock()
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|