aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/map_entry.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/map_entry.h')
-rw-r--r--src/google/protobuf/map_entry.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/google/protobuf/map_entry.h b/src/google/protobuf/map_entry.h
index 6971c763..4d3fcfb6 100644
--- a/src/google/protobuf/map_entry.h
+++ b/src/google/protobuf/map_entry.h
@@ -43,6 +43,10 @@ class Arena;
namespace protobuf {
namespace internal {
+// Register all MapEntry default instances so we can delete them in
+// ShutdownProtobufLibrary().
+void RegisterMapEntryDefaultInstance(MessageLite* default_instance);
+
// This is the common base class for MapEntry. It is used by MapFieldBase in
// reflection api, in which the static type of key and value is unknown.
class LIBPROTOBUF_EXPORT MapEntryBase : public Message {
@@ -317,6 +321,7 @@ class LIBPROTOBUF_EXPORT MapEntry : public MapEntryBase {
entry->reflection_ = reflection;
entry->default_instance_ = entry;
entry->InitAsDefaultInstance();
+ RegisterMapEntryDefaultInstance(entry);
return entry;
}