Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
329d103b
Commit
329d103b
authored
Dec 05, 2012
by
liujisi@google.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set pointers to NULL after shutdown, so the shutdown function can be called for multiple times.
parent
f5d5b4de
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
3 deletions
+52
-3
cpp_message.cc
src/google/protobuf/compiler/cpp/cpp_message.cc
+4
-2
cpp_string_field.cc
src/google/protobuf/compiler/cpp/cpp_string_field.cc
+2
-1
plugin.pb.cc
src/google/protobuf/compiler/plugin.pb.cc
+6
-0
descriptor.pb.cc
src/google/protobuf/descriptor.pb.cc
+40
-0
No files found.
src/google/protobuf/compiler/cpp/cpp_message.cc
View file @
329d103b
...
...
@@ -857,12 +857,14 @@ GenerateDefaultInstanceInitializer(io::Printer* printer) {
void
MessageGenerator
::
GenerateShutdownCode
(
io
::
Printer
*
printer
)
{
printer
->
Print
(
"delete $classname$::default_instance_;
\n
"
,
"delete $classname$::default_instance_;
\n
"
"$classname$::default_instance_ = NULL;
\n
"
,
"classname"
,
classname_
);
if
(
HasDescriptorMethods
(
descriptor_
->
file
()))
{
printer
->
Print
(
"delete $classname$_reflection_;
\n
"
,
"delete $classname$_reflection_;
\n
"
"$classname$_reflection_ = NULL;
\n
"
,
"classname"
,
classname_
);
}
...
...
src/google/protobuf/compiler/cpp/cpp_string_field.cc
View file @
329d103b
...
...
@@ -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
"
);
}
}
...
...
src/google/protobuf/compiler/plugin.pb.cc
View file @
329d103b
...
...
@@ -115,11 +115,17 @@ void protobuf_RegisterTypes(const ::std::string&) {
void
protobuf_ShutdownFile_google_2fprotobuf_2fcompiler_2fplugin_2eproto
()
{
delete
CodeGeneratorRequest
::
default_instance_
;
CodeGeneratorRequest
::
default_instance_
=
NULL
;
delete
CodeGeneratorRequest_reflection_
;
CodeGeneratorRequest_reflection_
=
NULL
;
delete
CodeGeneratorResponse
::
default_instance_
;
CodeGeneratorResponse
::
default_instance_
=
NULL
;
delete
CodeGeneratorResponse_reflection_
;
CodeGeneratorResponse_reflection_
=
NULL
;
delete
CodeGeneratorResponse_File
::
default_instance_
;
CodeGeneratorResponse_File
::
default_instance_
=
NULL
;
delete
CodeGeneratorResponse_File_reflection_
;
CodeGeneratorResponse_File_reflection_
=
NULL
;
}
void
protobuf_AddDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto
()
{
...
...
src/google/protobuf/descriptor.pb.cc
View file @
329d103b
...
...
@@ -518,45 +518,85 @@ void protobuf_RegisterTypes(const ::std::string&) {
void
protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto
()
{
delete
FileDescriptorSet
::
default_instance_
;
FileDescriptorSet
::
default_instance_
=
NULL
;
delete
FileDescriptorSet_reflection_
;
FileDescriptorSet_reflection_
=
NULL
;
delete
FileDescriptorProto
::
default_instance_
;
FileDescriptorProto
::
default_instance_
=
NULL
;
delete
FileDescriptorProto_reflection_
;
FileDescriptorProto_reflection_
=
NULL
;
delete
DescriptorProto
::
default_instance_
;
DescriptorProto
::
default_instance_
=
NULL
;
delete
DescriptorProto_reflection_
;
DescriptorProto_reflection_
=
NULL
;
delete
DescriptorProto_ExtensionRange
::
default_instance_
;
DescriptorProto_ExtensionRange
::
default_instance_
=
NULL
;
delete
DescriptorProto_ExtensionRange_reflection_
;
DescriptorProto_ExtensionRange_reflection_
=
NULL
;
delete
FieldDescriptorProto
::
default_instance_
;
FieldDescriptorProto
::
default_instance_
=
NULL
;
delete
FieldDescriptorProto_reflection_
;
FieldDescriptorProto_reflection_
=
NULL
;
delete
EnumDescriptorProto
::
default_instance_
;
EnumDescriptorProto
::
default_instance_
=
NULL
;
delete
EnumDescriptorProto_reflection_
;
EnumDescriptorProto_reflection_
=
NULL
;
delete
EnumValueDescriptorProto
::
default_instance_
;
EnumValueDescriptorProto
::
default_instance_
=
NULL
;
delete
EnumValueDescriptorProto_reflection_
;
EnumValueDescriptorProto_reflection_
=
NULL
;
delete
ServiceDescriptorProto
::
default_instance_
;
ServiceDescriptorProto
::
default_instance_
=
NULL
;
delete
ServiceDescriptorProto_reflection_
;
ServiceDescriptorProto_reflection_
=
NULL
;
delete
MethodDescriptorProto
::
default_instance_
;
MethodDescriptorProto
::
default_instance_
=
NULL
;
delete
MethodDescriptorProto_reflection_
;
MethodDescriptorProto_reflection_
=
NULL
;
delete
FileOptions
::
default_instance_
;
FileOptions
::
default_instance_
=
NULL
;
delete
FileOptions_reflection_
;
FileOptions_reflection_
=
NULL
;
delete
MessageOptions
::
default_instance_
;
MessageOptions
::
default_instance_
=
NULL
;
delete
MessageOptions_reflection_
;
MessageOptions_reflection_
=
NULL
;
delete
FieldOptions
::
default_instance_
;
FieldOptions
::
default_instance_
=
NULL
;
delete
FieldOptions_reflection_
;
FieldOptions_reflection_
=
NULL
;
delete
EnumOptions
::
default_instance_
;
EnumOptions
::
default_instance_
=
NULL
;
delete
EnumOptions_reflection_
;
EnumOptions_reflection_
=
NULL
;
delete
EnumValueOptions
::
default_instance_
;
EnumValueOptions
::
default_instance_
=
NULL
;
delete
EnumValueOptions_reflection_
;
EnumValueOptions_reflection_
=
NULL
;
delete
ServiceOptions
::
default_instance_
;
ServiceOptions
::
default_instance_
=
NULL
;
delete
ServiceOptions_reflection_
;
ServiceOptions_reflection_
=
NULL
;
delete
MethodOptions
::
default_instance_
;
MethodOptions
::
default_instance_
=
NULL
;
delete
MethodOptions_reflection_
;
MethodOptions_reflection_
=
NULL
;
delete
UninterpretedOption
::
default_instance_
;
UninterpretedOption
::
default_instance_
=
NULL
;
delete
UninterpretedOption_reflection_
;
UninterpretedOption_reflection_
=
NULL
;
delete
UninterpretedOption_NamePart
::
default_instance_
;
UninterpretedOption_NamePart
::
default_instance_
=
NULL
;
delete
UninterpretedOption_NamePart_reflection_
;
UninterpretedOption_NamePart_reflection_
=
NULL
;
delete
SourceCodeInfo
::
default_instance_
;
SourceCodeInfo
::
default_instance_
=
NULL
;
delete
SourceCodeInfo_reflection_
;
SourceCodeInfo_reflection_
=
NULL
;
delete
SourceCodeInfo_Location
::
default_instance_
;
SourceCodeInfo_Location
::
default_instance_
=
NULL
;
delete
SourceCodeInfo_Location_reflection_
;
SourceCodeInfo_Location_reflection_
=
NULL
;
}
void
protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment