Remove RemoveAllTreeNodes, since it was a no-op
IntermNode operator delete() or any of the IntermNode destructors don't
do anything, since all the AST memory is allocated on the PoolAllocator.
Because of this, RemoveAllTreeNodes was simply a no-op, and redundant
with the PoolAllocator deallocation procedure, and could confuse people
reading the code to think that IntermNodes should be deleted
individually, when in fact this is not the case.
BUG=angle:831
Change-Id: Ie1ccaa51986aabf267280d92a8e76ca9f97a19e5
Reviewed-on: https://chromium-review.googlesource.com/230730
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/Compiler.cpp b/src/compiler/translator/Compiler.cpp
index 9b273e8..ecb8c25 100644
--- a/src/compiler/translator/Compiler.cpp
+++ b/src/compiler/translator/Compiler.cpp
@@ -311,8 +311,8 @@
translate(root);
}
- // Cleanup memory.
- intermediate.remove(parseContext.treeRoot);
+ // Cleanup. The IntermNode tree doesn't need to be deleted here, since the
+ // memory will be freed in a big chunk by the PoolAllocator.
SetGlobalParseContext(NULL);
return success;
}