Made multiple calls to ShInitialize not assert.
BUG=456
R=apatrick@chromium.org, kbr@chromium.org
Review URL: https://codereview.appspot.com/11916046
diff --git a/src/common/version.h b/src/common/version.h
index 2e12512..0353fb4 100644
--- a/src/common/version.h
+++ b/src/common/version.h
@@ -1,7 +1,7 @@
#define MAJOR_VERSION 1
#define MINOR_VERSION 2
#define BUILD_VERSION 0
-#define BUILD_REVISION 2430
+#define BUILD_REVISION 2431
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
diff --git a/src/compiler/ShaderLang.cpp b/src/compiler/ShaderLang.cpp
index 5e4535e..147894e 100644
--- a/src/compiler/ShaderLang.cpp
+++ b/src/compiler/ShaderLang.cpp
@@ -85,12 +85,13 @@
}
//
-// Driver must call this first, once, before doing any other
-// compiler operations.
+// Driver must call this first, once, before doing any other compiler operations.
+// Subsequent calls to this function are no-op.
//
int ShInitialize()
{
- return InitProcess() ? 1 : 0;
+ static const bool kInitialized = InitProcess();
+ return kInitialized ? 1 : 0;
}
//