Commit ee9c7f17 authored by Feng Xiao's avatar Feng Xiao

Cleanup reflection objects for map entry.

parent 21b0b3ca
...@@ -751,6 +751,15 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) { ...@@ -751,6 +751,15 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) {
message_generators_[i]->GenerateShutdownCode(printer); message_generators_[i]->GenerateShutdownCode(printer);
} }
if (HasDescriptorMethods(file_, options_)) {
for (int i = 0; i < message_generators_.size(); i++) {
if (!IsMapEntryMessage(message_generators_[i]->descriptor_)) continue;
printer->Print(
"delete file_level_metadata[$index$].reflection;\n",
"index", SimpleItoa(i));
}
}
printer->Outdent(); printer->Outdent();
printer->Print( printer->Print(
"}\n\n"); "}\n\n");
......
...@@ -133,6 +133,7 @@ void TableStruct::Shutdown() { ...@@ -133,6 +133,7 @@ void TableStruct::Shutdown() {
delete file_level_metadata[2].reflection; delete file_level_metadata[2].reflection;
_ListValue_default_instance_.Shutdown(); _ListValue_default_instance_.Shutdown();
delete file_level_metadata[3].reflection; delete file_level_metadata[3].reflection;
delete file_level_metadata[0].reflection;
} }
void TableStruct::InitDefaultsImpl() { void TableStruct::InitDefaultsImpl() {
......
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