diff options
| author | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2022-03-05 10:34:28 -0500 |
|---|---|---|
| committer | Christian Hopps <chopps@labn.net> | 2022-03-14 11:14:12 -0400 |
| commit | 79c681952ea3b963a29beab9775e9a7f7e4f72bb (patch) | |
| tree | 76efe0bf774caeb9acd515a5051516f355fb5f3b /lib/northbound_grpc.cpp | |
| parent | e00241ad9f15208b0aae62203d0856114bf55fec (diff) | |
lib: call protobuf clean up on exit
Let's clean up the valgrind output even more by calling the protobuf
shutdown function that deallocates all library used memory.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'lib/northbound_grpc.cpp')
| -rw-r--r-- | lib/northbound_grpc.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/northbound_grpc.cpp b/lib/northbound_grpc.cpp index e2a6290035..31101f5c24 100644 --- a/lib/northbound_grpc.cpp +++ b/lib/northbound_grpc.cpp @@ -1400,6 +1400,11 @@ static int frr_grpc_finish(void) grpc_debug("%s: joining and destroy grpc thread", __func__); pthread_join(fpt->thread, NULL); frr_pthread_destroy(fpt); + + // Fix protobuf 'memory leaks' during shutdown. + // https://groups.google.com/g/protobuf/c/4y_EmQiCGgs + google::protobuf::ShutdownProtobufLibrary(); + return 0; } |
