Commit eb162dad authored by Paul Yang's avatar Paul Yang

Merge pull request #458 from xfxyjwf/memory_leak

Delete default UnknownFieldSet when shuting down.
parents c3cb53b8 37df4b65
......@@ -50,8 +50,13 @@ namespace {
// instantiate the UnknownFieldSet dynamically only when required.
UnknownFieldSet* default_unknown_field_set_instance_ = NULL;
void DeleteDefaultUnknownFieldSet() {
delete default_unknown_field_set_instance_;
}
void InitDefaultUnknownFieldSet() {
default_unknown_field_set_instance_ = new UnknownFieldSet();
internal::OnShutdown(&DeleteDefaultUnknownFieldSet);
}
GOOGLE_PROTOBUF_DECLARE_ONCE(default_unknown_field_set_once_init_);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment