diff --git a/pybind11_protobuf/BUILD b/pybind11_protobuf/BUILD index c664c9c..112316b 100644 --- a/pybind11_protobuf/BUILD +++ b/pybind11_protobuf/BUILD @@ -41,6 +41,7 @@ pybind_library( deps = [ ":check_unknown_fields", "@com_google_absl//absl/container:flat_hash_map", + "@com_google_absl//absl/debugging:leak_check", "@com_google_absl//absl/log", "@com_google_absl//absl/log:check", "@com_google_absl//absl/memory", diff --git a/pybind11_protobuf/proto_cast_util.cc b/pybind11_protobuf/proto_cast_util.cc index bbb5da7..395b999 100644 --- a/pybind11_protobuf/proto_cast_util.cc +++ b/pybind11_protobuf/proto_cast_util.cc @@ -13,6 +13,7 @@ #include #include +#include "absl/debugging/leak_check.h" #include "absl/container/flat_hash_map.h" #include "absl/log/check.h" #include "absl/log/log.h" @@ -155,7 +156,8 @@ class GlobalState { GlobalState*> storage; return storage - .call_once_and_store_result([]() { return new GlobalState(); }) + .call_once_and_store_result( + []() { return absl::IgnoreLeak(new GlobalState()); }) .get_stored(); }