Commit 3accf81e authored by Jisi Liu's avatar Jisi Liu

Clear oneofs.

parent f173cdeb
...@@ -508,6 +508,14 @@ void MessageGenerator::GenerateClear(io::Printer* printer) { ...@@ -508,6 +508,14 @@ void MessageGenerator::GenerateClear(io::Printer* printer) {
field_generators_.get(field).GenerateClearCode(printer); field_generators_.get(field).GenerateClearCode(printer);
} }
// Clear oneofs.
for (int i = 0; i < descriptor_->oneof_decl_count(); i++) {
printer->Print(
"clear$oneof_capitalized_name$();\n",
"oneof_capitalized_name", UnderscoresToCapitalizedCamelCase(
descriptor_->oneof_decl(i)));
}
// Clear unknown fields. // Clear unknown fields.
if (params_.store_unknown_fields()) { if (params_.store_unknown_fields()) {
printer->Print("unknownFieldData = null;\n"); printer->Print("unknownFieldData = null;\n");
......
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