aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/map_field.h
diff options
context:
space:
mode:
authorFeng Xiao <xfxyjwf@gmail.com>2015-05-25 19:04:00 -0700
committerFeng Xiao <xfxyjwf@gmail.com>2015-05-25 19:04:00 -0700
commit4e0c46f93d13b2ae74db2680af79e131969818e5 (patch)
tree90d70448f917a72c8c4d253888aa7e848efbda65 /src/google/protobuf/map_field.h
parent72f17c43675762b8ef46d73f953204de61ef0fed (diff)
downloadprotobuf-4e0c46f93d13b2ae74db2680af79e131969818e5.tar.gz
protobuf-4e0c46f93d13b2ae74db2680af79e131969818e5.tar.bz2
protobuf-4e0c46f93d13b2ae74db2680af79e131969818e5.zip
Explicitly call destructor of Mutex to release resources.
Change-Id: I808f4a3689e723d4490aa9ba6f1c14e3936ddcec
Diffstat (limited to 'src/google/protobuf/map_field.h')
-rw-r--r--src/google/protobuf/map_field.h6
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