aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2015-12-02 15:56:27 -0800
committerGravatar Craig Tiller <craig.tiller@gmail.com>2015-12-02 15:56:27 -0800
commit06dd04cfd30f3ea1f3e9cb0ad2be079f87e6b7b3 (patch)
tree2e2b1e49d251d6e585f3739c3acd3ec423ca30a1 /src
parent8352b9e99741bc2eb92144cef2c5fc041d3dce5c (diff)
Further review feedback
Diffstat (limited to 'src')
-rw-r--r--src/cpp/server/server.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc
index cc52c98b17..377c1ed167 100644
--- a/src/cpp/server/server.cc
+++ b/src/cpp/server/server.cc
@@ -60,12 +60,10 @@ class DefaultGlobalCallbacks GRPC_FINAL : public Server::GlobalCallbacks {
static Server::GlobalCallbacks* g_callbacks = nullptr;
static gpr_once g_once_init_callbacks = GPR_ONCE_INIT;
-static void DeleteGlobalCallbacks() { delete g_callbacks; }
-
static void InitGlobalCallbacks() {
if (g_callbacks == nullptr) {
- g_callbacks = new DefaultGlobalCallbacks();
- atexit(DeleteGlobalCallbacks);
+ static DefaultGlobalCallbacks default_global_callbacks;
+ g_callbacks = &default_global_callbacks;
}
}