我有两个线程在我打开表单时运行,然后关闭此表单以转到新表单,然后我返回到带有线程的表单,我收到此错误:
Exception in thread "Thread-4" java.lang.Error: Invalid memory access
at com.sun.jna.Native.invokeInt(Native Method)
at com.sun.jna.Function.invoke(Function.java:383)
at com.sun.jna.Function.invoke(Function.java:315)
at com.sun.jna.Library$Handler.invoke(Library.java:212)
at com.sun.proxy.$Proxy2.TessBaseAPIInit2(Unknown Source)
at net.sourceforge.tess4j.Tesseract.init(Tesseract.java:281)
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:215)
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:166)
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:151)
at utilitario.Util.procesaImagen(Util.java:22)
at pantallas.FrmVisImags$Hilosv.run(FrmVisImags.java:282)
线程的代码是:
public FrmVisualizaImags() {
initComponents();
bandera = false;
// setDefaultCloseOperation(DISPOSE_ON_CLOSE);
HilosProc hilosprc = new HilosProc();
hilosprc.start();
Hilosv hlv = new Hilosv();
hlv.start();
}