common.h

#include <google/protobuf/stubs/common.h>
namespace google::protobuf

Contains basic types and utilities used by the rest of the library.

Classes in this file

File Members

These definitions are not part of any class.
void
ShutdownProtobufLibrary()
Shut down the entire protocol buffers library, deleting all static-duration objects allocated by the library or by generated .pb.cc files. more...

void protobuf::ShutdownProtobufLibrary()

Shut down the entire protocol buffers library, deleting all static-duration objects allocated by the library or by generated .pb.cc files.

There are two reasons you might want to call this:

  • You use a draconian definition of "memory leak" in which you expect every single malloc() to have a corresponding free(), even for objects which live until program exit.
  • You are writing a dynamically-loaded library which needs to clean up after itself when the library is unloaded.

It is safe to call this multiple times. However, it is not safe to use any other part of the protocol buffers library after ShutdownProtobufLibrary() has been called.