0
我正在爬行谷歌几个小时寻找这种问题,但我找不到任何工作解决方案,我希望你们的伙伴们能够帮助我!当JVM死亡时,Safari浏览器崩溃
我有一个读取COM端口的java applet,在那个过程之后,我会杀死它,以便能够再次读取另一个applet,该applet在将用户重定向到另一个页面后被加载。
问题是,当我杀死第一个小程序,孔浏览器崩溃或关闭没有任何理由...
低于我的杀手锏功能^^
public void killMobileChecker() {
try {
System.exit(0);
} catch (Exception ex) {
if (log_level >= 4) {
ex.printStackTrace();
}
}
}
如果我不调用该函数safari不会关闭/崩溃,但下一个Java applet不能再读取COM端口。
有没有人有线索什么野生动物园或可能我做错了?
**编辑 脚本杀死所有打开的线程
private void closeConnection() {
if (portId != null && port_opened) {
try {
if (input != null) {
input.close();
}
if (output != null) {
output.close();
}
if (serialPort != null) {
serialPort.close();
}
port_opened = false;
} catch (Exception ioe) {
if (log_level >= 4) {
ioe.printStackTrace();
System.out.println("System_Error_closing_Comm_Port");
}
}
if (log_level >= 4) {
System.out.println("\r\nMobile Comm port closed\r\n");
}
// LogUtilities.writeLog("\r\nClosing Mobile Comm port...\r\n");
}
}
它听起来像你需要正确关闭COM端口,而不是关闭整个JVM – 2010-12-09 12:23:53