Fix memory leaks in angle_unittests.
Call ShDestruct() to destroy the compiler objects to
avoid memory leaks.
BUG=angle:737
Change-Id: I71a8ddfe67c9d8c7b4e5b5683c69dd578fc38c66
Reviewed-on: https://chromium-review.googlesource.com/215860
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Sudarsana Nagineni <sudarsana.nagineni@intel.com>
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 8c24c47..0cae10a 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -59,6 +59,7 @@
Jin Yang
Andy Chen
Josh Triplett
+ Sudarsana Nagineni
Klarälvdalens Datakonsult AB
Milian Wolff
diff --git a/tests/compiler_tests/ExpressionLimit_test.cpp b/tests/compiler_tests/ExpressionLimit_test.cpp
index 4e804dd..0236064 100644
--- a/tests/compiler_tests/ExpressionLimit_test.cpp
+++ b/tests/compiler_tests/ExpressionLimit_test.cpp
@@ -201,6 +201,7 @@
GenerateShaderWithLongExpression(
kMaxExpressionComplexity + 10).c_str(),
compileOptions & ~SH_LIMIT_EXPRESSION_COMPLEXITY, NULL));
+ ShDestruct(vertexCompiler);
}
TEST_F(ExpressionLimitTest, UnusedExpressionComplexity)
@@ -229,6 +230,7 @@
GenerateShaderWithUnusedLongExpression(
kMaxExpressionComplexity + 10).c_str(),
compileOptions & ~SH_LIMIT_EXPRESSION_COMPLEXITY, NULL));
+ ShDestruct(vertexCompiler);
}
TEST_F(ExpressionLimitTest, CallStackDepth)
@@ -257,6 +259,7 @@
GenerateShaderWithDeepFunctionStack(
kMaxCallStackDepth + 10).c_str(),
compileOptions & ~SH_LIMIT_CALL_STACK_DEPTH, NULL));
+ ShDestruct(vertexCompiler);
}
TEST_F(ExpressionLimitTest, UnusedCallStackDepth)
@@ -285,6 +288,7 @@
GenerateShaderWithUnusedDeepFunctionStack(
kMaxCallStackDepth + 10).c_str(),
compileOptions & ~SH_LIMIT_CALL_STACK_DEPTH, NULL));
+ ShDestruct(vertexCompiler);
}
TEST_F(ExpressionLimitTest, Recursion)
@@ -502,5 +506,6 @@
EXPECT_TRUE(CheckShaderCompilation(
vertexCompiler, shaderWithNoRecursion,
compileOptions | SH_LIMIT_CALL_STACK_DEPTH, NULL));
+ ShDestruct(vertexCompiler);
}