Commit df007eac by Jamie Madill

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/187845Reviewed-by: 's avatarNicolas Capens <nicolascapens@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 6ebf5a36
...@@ -51,7 +51,10 @@ static bool checkMappedNameMaxLength(const ShHandle handle, size_t expectedValue ...@@ -51,7 +51,10 @@ static bool checkMappedNameMaxLength(const ShHandle handle, size_t expectedValue
// //
int ShInitialize() int ShInitialize()
{ {
isInitialized = InitProcess(); if (!isInitialized)
{
isInitialized = InitProcess();
}
return isInitialized ? 1 : 0; return isInitialized ? 1 : 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment