From 74f3d952424ce2904ec35f98efaf4c0f2fed411d Mon Sep 17 00:00:00 2001 From: msepga Date: Thu, 21 Dec 2023 16:37:18 -0500 Subject: [PATCH] Call `ShutdownProtobufLibrary` in C++ builds, for valgrind runs --- src/pg_query_outfuncs_protobuf_cpp.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/pg_query_outfuncs_protobuf_cpp.cc b/src/pg_query_outfuncs_protobuf_cpp.cc index 2debb640..842702b9 100644 --- a/src/pg_query_outfuncs_protobuf_cpp.cc +++ b/src/pg_query_outfuncs_protobuf_cpp.cc @@ -266,3 +266,11 @@ pg_query_nodes_to_json(const void *obj) return pstrdup(output.c_str()); } + +class Cleanup +{ +public: + ~Cleanup() { google::protobuf::ShutdownProtobufLibrary(); } +}; + +Cleanup cleanup;