diff options
-rw-r--r-- | src/google/protobuf/map_field.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/google/protobuf/map_field.h b/src/google/protobuf/map_field.h index 902aefce..56d3d0f4 100644 --- a/src/google/protobuf/map_field.h +++ b/src/google/protobuf/map_field.h @@ -68,7 +68,11 @@ class LIBPROTOBUF_EXPORT MapFieldBase { repeated_field_(NULL), entry_descriptor_(NULL), assign_descriptor_callback_(NULL), - state_(STATE_MODIFIED_MAP) {} + state_(STATE_MODIFIED_MAP) { + // Mutex's destructor needs to be called explicitly to release resources + // acquired in its constructor. + arena->OwnDestructor(&mutex_); + } virtual ~MapFieldBase(); // Returns reference to internal repeated field. Data written using |