aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/compiler/cpp/cpp_string_field.cc
diff options
context:
space:
mode:
authorGravatar liujisi@google.com <liujisi@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2012-12-05 06:18:10 +0000
committerGravatar liujisi@google.com <liujisi@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2012-12-05 06:18:10 +0000
commit329d103b3e0f80fff5f9d1ed5a4be06d6f91b49f (patch)
tree8b680c84e04acfff5a07beeebc036e3c120f9a8b /src/google/protobuf/compiler/cpp/cpp_string_field.cc
parentf5d5b4de92710812929d9c82250959cb73daa11b (diff)
Set pointers to NULL after shutdown, so the shutdown function can be called for multiple times.
Diffstat (limited to 'src/google/protobuf/compiler/cpp/cpp_string_field.cc')
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_string_field.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/google/protobuf/compiler/cpp/cpp_string_field.cc b/src/google/protobuf/compiler/cpp/cpp_string_field.cc
index 9c0911ac..81d06549 100644
--- a/src/google/protobuf/compiler/cpp/cpp_string_field.cc
+++ b/src/google/protobuf/compiler/cpp/cpp_string_field.cc
@@ -251,7 +251,8 @@ void StringFieldGenerator::
GenerateShutdownCode(io::Printer* printer) const {
if (!descriptor_->default_value_string().empty()) {
printer->Print(variables_,
- "delete $classname$::$default_variable$;\n");
+ "delete $classname$::$default_variable$;\n"
+ "$classname$::$default_variable$ = NULL;\n");
}
}