diff options
Diffstat (limited to 'absl/flags/reflection.cc')
-rw-r--r-- | absl/flags/reflection.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/absl/flags/reflection.cc b/absl/flags/reflection.cc index dbce4032..841921a9 100644 --- a/absl/flags/reflection.cc +++ b/absl/flags/reflection.cc @@ -21,6 +21,7 @@ #include <string> #include "absl/base/config.h" +#include "absl/base/no_destructor.h" #include "absl/base/thread_annotations.h" #include "absl/container/flat_hash_map.h" #include "absl/flags/commandlineflag.h" @@ -169,7 +170,7 @@ void FlagRegistry::RegisterFlag(CommandLineFlag& flag, const char* filename) { } FlagRegistry& FlagRegistry::GlobalRegistry() { - static FlagRegistry* global_registry = new FlagRegistry; + static absl::NoDestructor<FlagRegistry> global_registry; return *global_registry; } |