未验证 提交 34e2f67e 编写于 作者: L liwenhe1993 提交者: GitHub

when running windows bat script, the handle is invalid in win7 (#2269)

上级 1fe5b314
...@@ -32,6 +32,7 @@ import java.util.concurrent.TimeUnit; ...@@ -32,6 +32,7 @@ import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import static com.sun.jna.platform.win32.WinBase.INVALID_HANDLE_VALUE;
import static com.sun.jna.platform.win32.WinBase.STILL_ACTIVE; import static com.sun.jna.platform.win32.WinBase.STILL_ACTIVE;
import static java.util.Objects.requireNonNull; import static java.util.Objects.requireNonNull;
...@@ -742,7 +743,9 @@ public class ProcessImplForWin32 extends Process { ...@@ -742,7 +743,9 @@ public class ProcessImplForWin32 extends Process {
} }
private static void closeHandle(WinNT.HANDLE handle) { private static void closeHandle(WinNT.HANDLE handle) {
Kernel32Util.closeHandle(handle); if (!handle.equals(INVALID_HANDLE_VALUE)) {
Kernel32Util.closeHandle(handle);
}
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册