]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib: call protobuf clean up on exit
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Sat, 5 Mar 2022 15:34:28 +0000 (10:34 -0500)
committerChristian Hopps <chopps@labn.net>
Mon, 14 Mar 2022 15:14:12 +0000 (11:14 -0400)
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>
lib/northbound_grpc.cpp

index e2a6290035885fd5a08eee701cc3fd76abf9b6ef..31101f5c241b1d6aaa1d45e31578374bbbbf8c63 100644 (file)
@@ -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;
 }