Fix crash on multiple calls to ShInitialize().
The previous fix would allow the calling app to trigger
an ASSERT if it did not first call ShFinalize. Chrome
would do this in some cases, causing a test failure.
BUG=344043
Change-Id: I33fa0c4668dac8750ca949febc7f02cc7d3d95e7
Reviewed-on: https://chromium-review.googlesource.com/187849
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/compiler/translator/ShaderLang.cpp b/src/compiler/translator/ShaderLang.cpp
index 9e2663d..5675f26 100644
--- a/src/compiler/translator/ShaderLang.cpp
+++ b/src/compiler/translator/ShaderLang.cpp
@@ -51,7 +51,10 @@
//
int ShInitialize()
{
- isInitialized = InitProcess();
+ if (!isInitialized)
+ {
+ isInitialized = InitProcess();
+ }
return isInitialized ? 1 : 0;
}