Merge remote-tracking branch 'dgq/fix-grpc-lib' into make_clang_great_again_v2

pull/5788/head
Vijay Pai 9 years ago
commit 2446114b8f
  1. 4
      include/grpc++/impl/grpc_library.h
  2. 3
      src/cpp/client/secure_credentials.cc

@ -58,9 +58,13 @@ static CoreCodegen g_core_codegen;
class GrpcLibraryInitializer GRPC_FINAL { class GrpcLibraryInitializer GRPC_FINAL {
public: public:
GrpcLibraryInitializer() { GrpcLibraryInitializer() {
if (grpc::g_glip == nullptr) {
grpc::g_glip = &g_gli; grpc::g_glip = &g_gli;
}
if (grpc::g_core_codegen_interface == nullptr) {
grpc::g_core_codegen_interface = &g_core_codegen; grpc::g_core_codegen_interface = &g_core_codegen;
} }
}
/// A no-op method to force the linker to reference this class, which will /// A no-op method to force the linker to reference this class, which will
/// take care of initializing and shutting down the gRPC runtime. /// take care of initializing and shutting down the gRPC runtime.

@ -60,8 +60,7 @@ std::shared_ptr<grpc::Channel> SecureChannelCredentials::CreateChannel(
SecureCallCredentials::SecureCallCredentials(grpc_call_credentials* c_creds) SecureCallCredentials::SecureCallCredentials(grpc_call_credentials* c_creds)
: c_creds_(c_creds) { : c_creds_(c_creds) {
internal::GrpcLibraryInitializer gli_initializer; g_gli_initializer.summon();
gli_initializer.summon();
} }
bool SecureCallCredentials::ApplyToCall(grpc_call* call) { bool SecureCallCredentials::ApplyToCall(grpc_call* call) {

Loading…
Cancel
Save