diff options
author | David Garcia Quintas <dgq@google.com> | 2016-03-18 15:53:28 -0700 |
---|---|---|
committer | David Garcia Quintas <dgq@google.com> | 2016-03-18 15:53:28 -0700 |
commit | 146070db8db189a62112ae0b84de5d12ffc02f3a (patch) | |
tree | 43fa71729b4af02cb413f5daaf2f042eb010fe29 /include | |
parent | a643960d458020d43e9432cd75f60355cce13946 (diff) |
fixed multiple initialization of globals
Diffstat (limited to 'include')
-rw-r--r-- | include/grpc++/impl/grpc_library.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/grpc++/impl/grpc_library.h b/include/grpc++/impl/grpc_library.h index d26f4a4cab..ecb5a4d64d 100644 --- a/include/grpc++/impl/grpc_library.h +++ b/include/grpc++/impl/grpc_library.h @@ -58,8 +58,12 @@ static CoreCodegen g_core_codegen; class GrpcLibraryInitializer GRPC_FINAL { public: GrpcLibraryInitializer() { - grpc::g_glip = &g_gli; - grpc::g_core_codegen_interface = &g_core_codegen; + if (grpc::g_glip == nullptr) { + grpc::g_glip = &g_gli; + } + if (grpc::g_core_codegen_interface == nullptr) { + grpc::g_core_codegen_interface = &g_core_codegen; + } } /// A no-op method to force the linker to reference this class, which will |