Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Kucera2007-06-22 13:19:24 -0400
committerMike Kucera2007-06-22 13:19:24 -0400
commit9eca80396a677a26d6723b87bc295fad92286f67 (patch)
tree8a4200d0e8712a43f9b1a11e38703d2bef98792f
parenta8fc0d2cbd671494880cb65e6bc1cf8daab801e0 (diff)
downloadorg.eclipse.cdt-9eca80396a677a26d6723b87bc295fad92286f67.tar.gz
org.eclipse.cdt-9eca80396a677a26d6723b87bc295fad92286f67.tar.xz
org.eclipse.cdt-9eca80396a677a26d6723b87bc295fad92286f67.zip
Fix for memory leak
-rw-r--r--upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCParser.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCParser.java b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCParser.java
index e0d60a5636..6b063b6fc6 100644
--- a/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCParser.java
+++ b/upc/org.eclipse.cdt.core.parser.upc/src/org/eclipse/cdt/internal/core/dom/parser/upc/UPCParser.java
@@ -91,7 +91,7 @@ public class UPCParser extends PrsStream implements RuleAction , IParserActionTo
for (int i = 0; i < unimplemented_symbols.size(); i++)
{
Integer id = (Integer) unimplemented_symbols.get(i);
- System.out.println(" " + UPCParsersym.orderedTerminalSymbols[id.intValue()]);//$NON-NLS-1$
+ System.out.println(" " + UPCParsersym.orderedTerminalSymbols[id.intValue()]);//$NON-NLS-1$
}
System.out.println();
}
@@ -172,8 +172,8 @@ public class UPCParser extends PrsStream implements RuleAction , IParserActionTo
}
-private UPCParserAction action = null;
-private List commentTokens = null;
+private UPCParserAction action = new UPCParserAction (this, UPCParserprs.orderedTerminalSymbols);
+private List commentTokens = new ArrayList();
private IKeywordMap keywordMap = new UPCKeywordMap ();
public UPCParser() { // constructor
@@ -240,6 +240,7 @@ public IParseResult parse() {
boolean encounteredError = action.encounteredError();
IASTCompletionNode compNode = action.getASTCompletionNode();
+ resetTokenStream(); // important, allows memory to be reclaimed
return new C99ParseResult(tu, compNode, encounteredError);
}

Back to the top