diff --git a/pdex/Todo, GSoC 2013.txt b/pdex/Todo, GSoC 2013.txt index 56d855234..54ca3a00b 100644 --- a/pdex/Todo, GSoC 2013.txt +++ b/pdex/Todo, GSoC 2013.txt @@ -133,10 +133,11 @@ Gotta do it carefully between main thread, ECS Thread, and SwingWorker threads Fields that are concurrently accessed: ECS members: -ArrayList problems - updated in ECS, accessed by ErrorBar.update() -ArrayList classpathJars - updated in ECS, accessed by ASTGenerator.loadJars() -hasErrors, syntaxErrors - Atomic Boolean -CompilationUnit cu - updated in ECS, accessed a zillion times in ASTGenerator :'( +x ArrayList problems - updated in ECS, accessed by ErrorBar.update() +x ArrayList classpathJars - updated in ECS, accessed by ASTGenerator.loadJars() +x hasErrors, syntaxErrors - Atomic Boolean +x boolean warningsEnabled - made it volatile +* CompilationUnit cu - updated in ECS, accessed a zillion times in ASTGenerator :'( General Stuff diff --git a/pdex/src/processing/mode/experimental/ASTGenerator.java b/pdex/src/processing/mode/experimental/ASTGenerator.java index 7bbcf32de..ff155444d 100644 --- a/pdex/src/processing/mode/experimental/ASTGenerator.java +++ b/pdex/src/processing/mode/experimental/ASTGenerator.java @@ -3090,6 +3090,19 @@ public class ASTGenerator { } } + + public void disposeAllWindows(){ + disposeWindow(frame2); + disposeWindow(frameAutoComp); + disposeWindow(frmImportSuggest); + disposeWindow(frmOccurenceList); + disposeWindow(frmRename); + } + + public static void disposeWindow(JFrame f) { + if(f != null) + f.dispose(); + } public static final String ignoredImports[] = { "com.oracle.", "sun.", "sunw.", "com.sun.", "javax.", "sunw.", "org.ietf.", diff --git a/pdex/src/processing/mode/experimental/ErrorCheckerService.java b/pdex/src/processing/mode/experimental/ErrorCheckerService.java index 9716c160f..5f6d1479a 100644 --- a/pdex/src/processing/mode/experimental/ErrorCheckerService.java +++ b/pdex/src/processing/mode/experimental/ErrorCheckerService.java @@ -282,6 +282,10 @@ public class ErrorCheckerService implements Runnable{ checkCode(); checkForMissingImports(); } + checkerClass = null; + astGenerator.disposeAllWindows(); + astGenerator = null; + logE("Thread stopped: " + editor.getSketch().getName()); } private void checkForMissingImports() { @@ -559,20 +563,20 @@ public class ErrorCheckerService implements Runnable{ } catch (ClassNotFoundException e) { System.err.println("Compiltation Checker files couldn't be found! " + e + " compileCheck() problem."); - stopThread(); + pauseThread(); } catch (MalformedURLException e) { System.err.println("Compiltation Checker files couldn't be found! " + e + " compileCheck() problem."); - stopThread(); + pauseThread(); } catch (Exception e) { System.err.println("compileCheck() problem." + e); e.printStackTrace(); - stopThread(); + pauseThread(); } catch (NoClassDefFoundError e) { System.err .println(e + " compileCheck() problem. Somebody tried to mess with Experimental Mode files."); - stopThread(); + pauseThread(); } // log("Compilecheck, Done."); } @@ -793,7 +797,7 @@ public class ErrorCheckerService implements Runnable{ } catch (Exception e) { log("Exception at updateErrorTable() " + e); e.printStackTrace(); - stopThread(); + pauseThread(); } } @@ -1397,6 +1401,7 @@ public class ErrorCheckerService implements Runnable{ * Stops the Error Checker Service thread */ public void stopThread() { + logE("Stopping thread: " + editor.getSketch().getName()); stopThread.set(true); } diff --git a/pdex/src/processing/mode/experimental/ErrorWindow.java b/pdex/src/processing/mode/experimental/ErrorWindow.java index 6494b58ed..4e7db2e36 100755 --- a/pdex/src/processing/mode/experimental/ErrorWindow.java +++ b/pdex/src/processing/mode/experimental/ErrorWindow.java @@ -183,7 +183,7 @@ public class ErrorWindow extends JFrame { return; } - thisEditor.addWindowListener(new WindowAdapter() { + /*thisEditor.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { @@ -207,7 +207,7 @@ public class ErrorWindow extends JFrame { thisErrorWindow.setExtendedState(Frame.NORMAL); } - }); + });*/ thisEditor.addComponentListener(new ComponentListener() {